mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
fix: address comments
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Inject, Injectable, DOCUMENT } from '@angular/core'
|
||||
import { inject, Injectable } from '@angular/core'
|
||||
import { WA_LOCAL_STORAGE } from '@ng-web-apis/common'
|
||||
|
||||
const PREFIX = '_startos/'
|
||||
|
||||
@@ -6,9 +7,7 @@ const PREFIX = '_startos/'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class StorageService {
|
||||
private readonly storage = this.document.defaultView!.localStorage
|
||||
|
||||
constructor(@Inject(DOCUMENT) private readonly document: Document) {}
|
||||
private readonly storage = inject(WA_LOCAL_STORAGE)
|
||||
|
||||
get<T>(key: string): T {
|
||||
return JSON.parse(String(this.storage.getItem(`${PREFIX}${key}`)))
|
||||
|
||||
Reference in New Issue
Block a user