diff --git a/src/app/components/settings/settings.component.html b/src/app/components/settings/settings.component.html
index 9954faf..59e8719 100644
--- a/src/app/components/settings/settings.component.html
+++ b/src/app/components/settings/settings.component.html
@@ -36,7 +36,7 @@
(this will be possible in a future update to Bridge)
-
+
+
+
+ Update available
+ v0.0.0
+
+
diff --git a/src/app/components/settings/settings.component.scss b/src/app/components/settings/settings.component.scss
index e258e7b..96b32c1 100644
--- a/src/app/components/settings/settings.component.scss
+++ b/src/app/components/settings/settings.component.scss
@@ -17,4 +17,8 @@
position: absolute;
bottom: 2em;
right: 2em;
+}
+
+#versionNumberButton {
+ margin-right: 1em;
}
\ No newline at end of file
diff --git a/src/app/components/settings/settings.component.ts b/src/app/components/settings/settings.component.ts
index e63ae5a..4deb6f4 100644
--- a/src/app/components/settings/settings.component.ts
+++ b/src/app/components/settings/settings.component.ts
@@ -8,23 +8,30 @@ import { SettingsService } from 'src/app/core/services/settings.service'
styleUrls: ['./settings.component.scss']
})
export class SettingsComponent implements OnInit, AfterViewInit {
- @ViewChild('themeDropdown', { static: true }) themeDropdown: ElementRef
+ // @ViewChild('themeDropdown', { static: true }) themeDropdown: ElementRef
cacheSize = 'Calculating...'
+ updateAvailable = false
+ updateVersion: string = null
constructor(public settingsService: SettingsService, private electronService: ElectronService) { }
async ngOnInit() {
const cacheSize = await this.settingsService.getCacheSize()
this.cacheSize = Math.round(cacheSize / 1000000) + ' MB'
+ this.electronService.receiveIPC('update-available', (result) => {
+ this.updateVersion = result.version
+ this.updateAvailable = true
+ })
+ this.updateAvailable = await this.electronService.invoke('get-update-available', undefined)
}
ngAfterViewInit() {
- $(this.themeDropdown.nativeElement).dropdown({
- onChange: (_value: string, text: string) => {
- this.settingsService.theme = text
- }
- })
+ // $(this.themeDropdown.nativeElement).dropdown({
+ // onChange: (_value: string, text: string) => {
+ // this.settingsService.theme = text
+ // }
+ // })
}
async clearCache() {
@@ -55,6 +62,18 @@ export class SettingsComponent implements OnInit, AfterViewInit {
this.settingsService.rateLimitDelay = Number(inputElement.value)
}
+ downloadUpdate() {
+ this.electronService.sendIPC('download-update', undefined)
+ this.electronService.receiveIPC('update-progress', (result) => console.log(result.percent))
+ this.electronService.receiveIPC('update-downloaded', (result) => {
+ console.log(result)
+ setTimeout(() => {
+ console.log('quit and install...')
+ this.electronService.sendIPC('quit-and-install', undefined)
+ }, 30000)
+ })
+ }
+
toggleDevTools() {
const toolsOpened = this.electronService.currentWindow.webContents.isDevToolsOpened()
diff --git a/src/app/components/toolbar/toolbar.component.html b/src/app/components/toolbar/toolbar.component.html
index af50ed0..1a26a85 100644
--- a/src/app/components/toolbar/toolbar.component.html
+++ b/src/app/components/toolbar/toolbar.component.html
@@ -1,8 +1,7 @@