Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit cc962c9

Browse files
committed
show warning when LL is disabled but was enabled before
1 parent 573029a commit cc962c9

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

src/Lifecycle.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,19 @@ function _handleLoadSessionFailure(e) {
250250
onFinished: resolve,
251251
});
252252
});
253+
} else {
254+
// show warning about simultaneous use
255+
// between LL/non-LL version on same host.
256+
// as disabling LL when previously enabled
257+
// is a strong indicator of this (/develop & /app)
258+
const LazyLoadingDisabledDialog =
259+
sdk.getComponent("views.dialogs.LazyLoadingDisabledDialog");
260+
return new Promise((resolve) => {
261+
Modal.createDialog(LazyLoadingDisabledDialog, {
262+
onFinished: resolve,
263+
host: window.location.host,
264+
});
265+
});
253266
}
254267
}).then(() => {
255268
return MatrixClientPeg.get().store.deleteAllData();
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
Copyright 2018 New Vector Ltd
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
import React from 'react';
18+
import QuestionDialog from './QuestionDialog';
19+
import { _t } from '../../../languageHandler';
20+
21+
export default (props) => {
22+
const description1 =
23+
_t("You've previously used Riot on %(host)s with lazy loading of members enabled. " +
24+
"In this version lazy loading is disabled. " +
25+
"As the local cache is not compatible between these two settings, " +
26+
"Riot needs to resync your account.",
27+
{host: props.host});
28+
const description2 = _t("If the other version of Riot is still open in another tab, " +
29+
"please close it as using Riot on the same host with both " +
30+
"lazy loading enabled and disabled simultaneously will cause issues.");
31+
32+
return (<QuestionDialog
33+
hasCancelButton={false}
34+
title={_t("Incompatible local cache")}
35+
description={<div><p>{description1}</p><p>{description2}</p></div>}
36+
button={_t("Clear cache and resync")}
37+
onFinished={props.onFinished}
38+
/>);
39+
};

src/i18n/strings/en_EN.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,5 +1259,9 @@
12591259
"Import": "Import",
12601260
"Failed to set direct chat tag": "Failed to set direct chat tag",
12611261
"Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room",
1262-
"Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room"
1262+
"Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room",
1263+
"You've previously used Riot on %(host)s with lazy loading of members enabled. In this version lazy loading is disabled. As the local cache is not compatible between these two settings, Riot needs to resync your account.": "You've previously used Riot on %(host)s with lazy loading of members enabled. In this version lazy loading is disabled. As the local cache is not compatible between these two settings, Riot needs to resync your account.",
1264+
"If the other version of Riot is still open in another tab, please close it as using Riot on the same host with both lazy loading enabled and disabled simultaneously will cause issues.": "If the other version of Riot is still open in another tab, please close it as using Riot on the same host with both lazy loading enabled and disabled simultaneously will cause issues.",
1265+
"Incompatible local cache": "Incompatible local cache",
1266+
"Clear cache and resync": "Clear cache and resync"
12631267
}

0 commit comments

Comments
 (0)