diff --git a/capacitor/android/variables.gradle b/capacitor/android/variables.gradle index 5946ada..58af7a5 100644 --- a/capacitor/android/variables.gradle +++ b/capacitor/android/variables.gradle @@ -1,7 +1,7 @@ ext { minSdkVersion = 22 - compileSdkVersion = 33 - targetSdkVersion = 33 + compileSdkVersion = 34 + targetSdkVersion = 34 androidxActivityVersion = '1.7.0' androidxAppCompatVersion = '1.6.1' androidxCoordinatorLayoutVersion = '1.2.0' diff --git a/common/components/Sidebar.svelte b/common/components/Sidebar.svelte index 9328df9..a644830 100644 --- a/common/components/Sidebar.svelte +++ b/common/components/Sidebar.svelte @@ -9,9 +9,40 @@ import { logout } from './Logout.svelte' import { rss } from '@/views/TorrentSearch/TorrentModal.svelte' import IPC from '@/modules/ipc.js' + + let wasUpdated = false + + globalThis.dd = IPC + + IPC.on('update-available', () => { + console.log('uwu') + if (!wasUpdated) { + // insert icon in 2nd to last position + links.splice(links.length - 1, 0, { + click: () => { + toast('Update is downloading...') + }, + icon: 'download', + text: 'Update Downloading...' + }) + links = links + } + wasUpdated = true + }) + IPC.on('update-downloaded', () => { + links[links.length - 2].css = 'update' + links[links.length - 2].text = 'Update Ready!' + links[links.length - 2].click = () => { + IPC.emit('quit-and-install') + } + links = links + }) + const view = getContext('view') + export let page - const links = [ + + let links = [ { click: () => { if (anilistClient.userID?.viewer?.data?.Viewer) { @@ -109,7 +140,7 @@