Skip to content

Commit ca9740c

Browse files
committed
Show a toast notification when changing security profiles
For wasm builds only. "Page will automatically reload in 5 seconds" Part of #1881
1 parent e9ba767 commit ca9740c

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

pages/settings/PageSettingsAccessAndSecurity.qml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ Page {
202202
// This guards the wasm version to trigger a reload even if the reply isn't received.
203203
BackendConnection.securityProtocolChanged()
204204
Global.pageManager.popPage()
205+
if (Qt.platform.os === "wasm" && !BackendConnection.vrm) {
206+
Global.showToastNotification(VenusOS.Notification_Info,
207+
//% "Page will automatically reload in 5 seconds"
208+
qsTrId("access_and_security_page_will_reload"),
209+
3000)
210+
}
205211
}
206212
dialogDoneOptions: VenusOS.ModalDialog_DoneOptions_OkAndCancel
207213
height: securityProfile.pendingProfile === VenusOS.Security_Profile_Secured

src/backendconnection.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ void BackendConnection::onReloadPageTimerExpired()
199199
// that fails and still triggers a reload (albeit a bit later).
200200
void BackendConnection::securityProtocolChanged()
201201
{
202+
if (isVrm())
203+
{
204+
return;
205+
}
202206
QTimer *timer = new QTimer(this);
203207
connect(timer, &QTimer::timeout, this, &BackendConnection::onReloadPageTimerExpired);
204208
connect(timer, &QTimer::timeout, timer, &QObject::deleteLater);

wasm/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
status.innerHTML = 'Loading...';
7575

7676
const instance = await qtLoad({
77-
arguments: ['--mqtt', (location.protocol === 'https:' ? 'wss://' : 'ws://') + document.location.host + '/websocket-mqtt'], // delete this line to run wasm builds on the desktop
7877
qt: {
7978
onLoaded: () => showUi(screen),
8079
onExit: exitData =>

0 commit comments

Comments
 (0)