mirror of
https://github.com/jwetzell/showbridge-webui.git
synced 2026-08-10 00:53:39 +00:00
store baseurl in local storage
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@
|
||||
class="pl-1 border-2 border-gray-200 text-white border-solid rounded-sm"
|
||||
[placeholder]="'http://localhost:8000'"
|
||||
[value]="settingsService.baseUrl()"
|
||||
(change)="settingsService.baseUrl.set($event.target.value)"
|
||||
(change)="settingsService.updateBaseUrl($event.target.value)"
|
||||
/>
|
||||
</div>
|
||||
<span class="flex-auto"></span>
|
||||
|
||||
@@ -40,9 +40,15 @@ export class SettingsService {
|
||||
return url;
|
||||
});
|
||||
|
||||
constructor() {}
|
||||
constructor() {
|
||||
const storedBaseUrl = localStorage.getItem('baseUrl');
|
||||
if (storedBaseUrl) {
|
||||
this.baseUrl.set(storedBaseUrl);
|
||||
}
|
||||
}
|
||||
|
||||
updateBaseUrl(baseUrl: string) {
|
||||
this.baseUrl.set(baseUrl);
|
||||
localStorage.setItem('baseUrl', baseUrl);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user