fix: address comments

This commit is contained in:
waterplea
2025-11-05 11:10:33 +04:00
parent 056a9ff9b6
commit e0995a63ca
5 changed files with 25 additions and 10 deletions

View File

@@ -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}`)))