Skip to content
This repository has been archived by the owner on Jun 15, 2019. It is now read-only.

Commit

Permalink
Do not load on new modmail if redesign toolbox is already active
Browse files Browse the repository at this point in the history
  • Loading branch information
creesch committed Mar 11, 2018
1 parent 9b66e93 commit 662018d
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions extension/data/tbstorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

function storagewrapper() {
(function (TBStorage) {
if ((!$('form.logout input[name=uh]').val() && $('.Header__profile').length === 0) || $('.mod-toolbox').length) return; // not logged in or toolbox is already loaded.
if ((!$('form.logout input[name=uh]').val() && $('.Header__profile').length === 0) || $('.mod-toolbox').length || $('.mod-toolbox-rd').length) return; // not logged in or toolbox is already loaded.


var SHORTNAME = 'TBStorage';
Expand Down Expand Up @@ -336,10 +336,19 @@ function storagewrapper() {


function SendInit() {
setTimeout(function () {
var event = new CustomEvent('TBStorageLoaded');
window.dispatchEvent(event);
}, 10);
if(window.location.hostname === 'mod.reddit.com') {
setTimeout(function () {
if(!$('body').hasClass('mod-toolbox-rd')) {
var event = new CustomEvent('TBStorageLoaded');
window.dispatchEvent(event);
}
}, 1000);
} else {
setTimeout(function () {
var event = new CustomEvent('TBStorageLoaded');
window.dispatchEvent(event);
}, 10);
}
}


Expand Down

0 comments on commit 662018d

Please sign in to comment.