mirror of
https://github.com/Zaarrg/stremio-community-v5.git
synced 2026-04-21 00:52:01 +00:00
updater thread update message not being send fix
- Fixed update thread not being able to send update message if not send before app-ready event.
This commit is contained in:
parent
0fdb9f457c
commit
a0afad91e2
1 changed files with 14 additions and 1 deletions
15
src/main.cpp
15
src/main.cpp
|
|
@ -78,6 +78,10 @@ static HHOOK g_hMouseHook = nullptr;
|
|||
std::wstring g_webuiUrl = L"https://zaarrg.github.io/stremio-web-shell-fixes/";
|
||||
std::string g_updateUrl = "https://raw.githubusercontent.com/Zaarrg/stremio-desktop-v5/refs/heads/webview-windows/version/version.json";
|
||||
|
||||
//Updater thread message
|
||||
#define WM_NOTIFY_UPDATE (WM_USER + 101)
|
||||
static json g_pendingUpdateMsg;
|
||||
|
||||
//Args
|
||||
bool g_streamingServer = true;
|
||||
bool g_autoupdaterForceFull = false;
|
||||
|
|
@ -2343,7 +2347,8 @@ static void RunAutoUpdaterOnce() {
|
|||
|
||||
json j;
|
||||
j["type"] ="requestUpdate";
|
||||
SendToJS(j);
|
||||
g_pendingUpdateMsg = j;
|
||||
PostMessage(g_hWnd, WM_NOTIFY_UPDATE, 0, 0);
|
||||
} else {
|
||||
std::cout<<"Installer download failed. Skipping update prompt.\n";
|
||||
}
|
||||
|
|
@ -2438,6 +2443,14 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
break;
|
||||
}
|
||||
|
||||
case WM_NOTIFY_UPDATE: {
|
||||
if (!g_pendingUpdateMsg.is_null()) {
|
||||
SendToJS(g_pendingUpdateMsg);
|
||||
g_pendingUpdateMsg = json();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_SETTINGCHANGE:
|
||||
UpdateTheme(g_hWnd);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue