This repository was archived by the owner on Dec 11, 2019. It is now read-only.
Commit 1317c77 1 parent c30c613 commit 1317c77 Copy full SHA for 1317c77
File tree 5 files changed +25
-4
lines changed
5 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -108,9 +108,8 @@ module.exports.newTorIdentityMenuItem = () => {
108
108
return {
109
109
label : locale . translation ( 'newTorIdentity' ) ,
110
110
click : function ( item , focusedWindow ) {
111
- // TODO
112
- } ,
113
- enabled : false
111
+ appActions . setTorNewIdentity ( )
112
+ }
114
113
}
115
114
}
116
115
Original file line number Diff line number Diff line change @@ -701,6 +701,15 @@ module.exports.checkTorAvailable = () => {
701
701
} , 500 )
702
702
}
703
703
704
+ module . exports . setTorNewIdentity = ( url ) => {
705
+ const origin = getOrigin ( url )
706
+ const ses = session . fromPartition ( 'persist:tor' )
707
+ if ( ! ses || ! origin ) {
708
+ return
709
+ }
710
+ ses . setTorNewIdentity ( origin )
711
+ }
712
+
704
713
function initSession ( ses , partition ) {
705
714
registeredSessions [ partition ] = ses
706
715
ses . setEnableBrotli ( true )
Original file line number Diff line number Diff line change @@ -1968,6 +1968,12 @@ const appActions = {
1968
1968
dispatch ( {
1969
1969
actionType : appConstants . APP_CHECK_TOR_AVAILABLE
1970
1970
} )
1971
+ } ,
1972
+
1973
+ setTorNewIdentity : function ( ) {
1974
+ dispatch ( {
1975
+ actionType : appConstants . APP_SET_TOR_NEW_IDENTITY
1976
+ } )
1971
1977
}
1972
1978
}
1973
1979
Original file line number Diff line number Diff line change @@ -198,7 +198,8 @@ const appConstants = {
198
198
APP_CHECK_REFERRAL_ACTIVITY : _ ,
199
199
APP_ON_REFERRAL_ACTIVITY : _ ,
200
200
APP_ON_LEDGER_MEDIA_PUBLISHER : _ ,
201
- APP_CHECK_TOR_AVAILABLE : _
201
+ APP_CHECK_TOR_AVAILABLE : _ ,
202
+ APP_SET_TOR_NEW_IDENTITY : _
202
203
}
203
204
204
205
module . exports = mapValuesByKeys ( appConstants )
Original file line number Diff line number Diff line change @@ -391,6 +391,12 @@ const handleAppAction = (action) => {
391
391
case appConstants . APP_CHECK_TOR_AVAILABLE :
392
392
filtering . checkTorAvailable ( )
393
393
break
394
+ case appConstants . APP_SET_TOR_NEW_IDENTITY :
395
+ const activeTab = tabState . getActiveTab ( appState )
396
+ if ( activeTab ) {
397
+ filtering . setTorNewIdentity ( activeTab . get ( 'url' ) )
398
+ }
399
+ break
394
400
case appConstants . APP_ON_CLEAR_BROWSING_DATA :
395
401
const defaults = appState . get ( 'clearBrowsingDataDefaults' )
396
402
const temp = appState . get ( 'tempClearBrowsingData' , Immutable . Map ( ) )
You can’t perform that action at this time.
0 commit comments