store baseurl in local storage

This commit is contained in:
Joel Wetzell
2026-03-19 21:55:25 -05:00
parent efdb2ab723
commit 7c5dfbc947
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -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>
+7 -1
View File
@@ -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);
}
}