This repository was archived by the owner on Dec 11, 2019. It is now read-only.
Commit 9ead2f1 1 parent 55dace2 commit 9ead2f1 Copy full SHA for 9ead2f1
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 @@ -698,6 +698,15 @@ module.exports.checkTorAvailable = () => {
698
698
} , 500 )
699
699
}
700
700
701
+ module . exports . setTorNewIdentity = ( url ) => {
702
+ const origin = getOrigin ( url )
703
+ const ses = session . fromPartition ( 'persist:tor' )
704
+ if ( ! ses || ! origin ) {
705
+ return
706
+ }
707
+ ses . setTorNewIdentity ( origin )
708
+ }
709
+
701
710
function initSession ( ses , partition ) {
702
711
registeredSessions [ partition ] = ses
703
712
ses . setEnableBrotli ( true )
Original file line number Diff line number Diff line change @@ -1920,6 +1920,12 @@ const appActions = {
1920
1920
dispatch ( {
1921
1921
actionType : appConstants . APP_CHECK_TOR_AVAILABLE
1922
1922
} )
1923
+ } ,
1924
+
1925
+ setTorNewIdentity : function ( ) {
1926
+ dispatch ( {
1927
+ actionType : appConstants . APP_SET_TOR_NEW_IDENTITY
1928
+ } )
1923
1929
}
1924
1930
}
1925
1931
Original file line number Diff line number Diff line change @@ -193,7 +193,8 @@ const appConstants = {
193
193
APP_ON_PRUNE_SYNOPSIS : _ ,
194
194
APP_ON_HISTORY_LIMIT : _ ,
195
195
APP_ON_LEDGER_MEDIA_PUBLISHER : _ ,
196
- APP_CHECK_TOR_AVAILABLE : _
196
+ APP_CHECK_TOR_AVAILABLE : _ ,
197
+ APP_SET_TOR_NEW_IDENTITY : _
197
198
}
198
199
199
200
module . exports = mapValuesByKeys ( appConstants )
Original file line number Diff line number Diff line change @@ -368,6 +368,12 @@ const handleAppAction = (action) => {
368
368
case appConstants . APP_CHECK_TOR_AVAILABLE :
369
369
filtering . checkTorAvailable ( )
370
370
break
371
+ case appConstants . APP_SET_TOR_NEW_IDENTITY :
372
+ const activeTab = tabState . getActiveTab ( appState )
373
+ if ( activeTab ) {
374
+ filtering . setTorNewIdentity ( activeTab . get ( 'url' ) )
375
+ }
376
+ break
371
377
case appConstants . APP_ON_CLEAR_BROWSING_DATA :
372
378
const defaults = appState . get ( 'clearBrowsingDataDefaults' )
373
379
const temp = appState . get ( 'tempClearBrowsingData' , Immutable . Map ( ) )
You can’t perform that action at this time.
0 commit comments