mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-26 22:54:45 +00:00
add a quick hack to not execute loadModalFromHash() until the basic initialization is finished
This commit is contained in:
parent
01aed4bba7
commit
987090bd27
@ -24,6 +24,7 @@ var twister = {
|
||||
return req.toString().replace(/GMT.*/g, '');
|
||||
}
|
||||
},
|
||||
initializated: false,
|
||||
isCurrentInputSplittable: false,
|
||||
localAccounts: [],
|
||||
updatesCheckClient: {}
|
||||
@ -1316,6 +1317,11 @@ function loadModalFromHash() {
|
||||
}
|
||||
var hashdata = hashstring.split(':');
|
||||
|
||||
if (!twister.var.initializated) {
|
||||
setTimeout(loadModalFromHash, 1000);
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME rework hash scheme from '#following?user=twister' to something like '#/@twister/following'
|
||||
if (hashdata[0] !== '#web+twister')
|
||||
hashdata = hashstring.match(/(hashtag|profile|mentions|directmessages|followers|following|conversation|favs)\?(?:group|user|hashtag|post)=(.+)/);
|
||||
|
@ -58,6 +58,7 @@ var InterfaceFunctions = function() {
|
||||
$(".dropdown-menu-following").attr("href","#");
|
||||
$('.dropdown-menu-following').on('click', function ()
|
||||
{ alert(polyglot.t("You are not following anyone because you are not logged in."))} );
|
||||
twister.var.initializated = true;
|
||||
} else {
|
||||
$miniProfile.find("a.mini-profile-name").attr("href",$.MAL.userUrl(defaultScreenName));
|
||||
$miniProfile.find("a.open-profile-modal").attr("href",$.MAL.userUrl(defaultScreenName));
|
||||
@ -71,6 +72,7 @@ var InterfaceFunctions = function() {
|
||||
getFollowers( defaultScreenName, $miniProfile.find(".followers-count") );
|
||||
|
||||
loadFollowing( function(args) {
|
||||
twister.var.initializated = true;
|
||||
$(".mini-profile .following-count").text(followingUsers.length-1);
|
||||
requestLastHave();
|
||||
setInterval(requestLastHave, 1000);
|
||||
|
Loading…
x
Reference in New Issue
Block a user