Skip to content

Commit

Permalink
Bugfix: ask unload when mobile and message visible
Browse files Browse the repository at this point in the history
  • Loading branch information
the-djmaze committed Mar 20, 2023
1 parent 470da2e commit 45be0d7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dev/App/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export class AppUser extends AbstractApp {
super.bootstart();

addEventListener('beforeunload', event => {
if (arePopupsVisible() || (!SettingsUserStore.layout() && MessageUserStore.message())) {
if (arePopupsVisible() || (!SettingsUserStore.usePreviewPane() && MessageUserStore.message())) {
event.preventDefault();
return event.returnValue = i18n('POPUPS_ASK/EXIT_ARE_YOU_SURE');
}
Expand Down
4 changes: 2 additions & 2 deletions dev/Stores/User/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ export const SettingsUserStore = new class {

self.init();

self.usePreviewPane = koComputable(() => self.layout() && !ThemeStore.isMobile());
self.usePreviewPane = koComputable(() => ThemeStore.isMobile() ? 0 : self.layout());

const toggleLayout = () => {
const value = ThemeStore.isMobile() ? 0 : self.layout();
const value = self.usePreviewPane();
$htmlCL.toggle('sm-msgView-side', Layout.SidePreview === value);
$htmlCL.toggle('sm-msgView-bottom', Layout.BottomPreview === value);
fireEvent('rl-layout', value);
Expand Down
6 changes: 2 additions & 4 deletions dev/View/User/MailBox/MessageList.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,11 +566,9 @@ export class MailMessageList extends AbstractViewRight {
// initMailboxLayoutResizer
const top = dom.querySelector('.messageList'),
fToggle = () => {
let layout = SettingsUserStore.layout();
let layout = SettingsUserStore.usePreviewPane();
setLayoutResizer(top, ClientSideKeyNameMessageListSize,
(ThemeStore.isMobile() || !layout)
? 0
: (Layout.SidePreview === layout ? 'Width' : 'Height')
layout ? (Layout.SidePreview === layout ? 'Width' : 'Height') : 0
);
};
if (top) {
Expand Down

0 comments on commit 45be0d7

Please sign in to comment.