Fixed bug where changing header of profile was returning old profile + UI improvements

This commit is contained in:
Bofh 2021-01-17 21:30:49 +01:00
parent 6d599f1b4d
commit 33455f191a
2 changed files with 14 additions and 3 deletions

View File

@ -345,6 +345,14 @@ div#theToast.match {
}
}
div#theToast.maybe {
div.toast-modal > div.toast-container {
font-weight: bold;
background-image: linear-gradient(#ffdaef, #a8a9ff);
border-radius: 2em;
}
}
div#chat-party-global {
display: flex;
height: 3.6em;

View File

@ -330,7 +330,7 @@ var fediloveUI = {
accounts[accObj.id] = Date.now() + expire;
window.localStorage.store_maybeAccounts = JSON.stringify(accounts);
fediloveUI.toast(window.__intl.maybeAction, 2000);
fediloveUI.toast(window.__intl.maybeAction, 2000, 'maybe');
fediloveUI.animateMainContentSwipe('acceptMeet', function() { window.history.back() });
}
};
@ -345,11 +345,14 @@ var fediloveApi = {
document.getElementById(_id).click();
document.body.removeChild(a);
},
getMeetAccount: function() {
getMeetAccount: function(directlyFromStore) {
directlyFromStore = directlyFromStore || false;
if (window.localStorage.store_meetAccounts === undefined)
return undefined;
if (document.getElementById(window.fediloveData.currentIDMeetTimeline) === undefined)
return undefined;
if (directlyFromStore)
return window.__store.get().currentAccountProfile;
var accId;
if (window.location.pathname == '/meet')
accId = $(document.getElementById(window.fediloveData.currentIDMeetTimeline)).data('account');
@ -708,7 +711,7 @@ function fedilove_customization() {
const _applyImageTo = function(selector) {
setTimeout(function()
{ // set image of first item to the account header (100ms after cloning the object)
const accObj = window.fediloveApi.getMeetAccount();
const accObj = window.fediloveApi.getMeetAccount(true);
if (accObj !== undefined) {
if ($(selector)[0] !== undefined)
$(selector)[0].src = accObj.header;