-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
246 additions
and
24 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { IStorageProvider, UtilsService } from '@resgrid/ngx-resgridlib'; | ||
import { StartupData } from '../features/settings/models/startupData'; | ||
import { LoginResult } from '../models/loginResult'; | ||
import { Preferences } from '@capacitor/preferences'; | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class ModuleStorageProvider implements IStorageProvider { | ||
public async read(key: string): Promise<string> { | ||
const { value } = await Preferences?.get({ key: key }); | ||
|
||
return value; | ||
} | ||
|
||
public async write(key: string, value: string): Promise<void> { | ||
return await Preferences?.set({ | ||
key: key, | ||
value: value, | ||
}); | ||
} | ||
|
||
public async remove(key: string): Promise<void> { | ||
return await Preferences?.remove({key: key}); | ||
} | ||
|
||
public async clear(): Promise<any> { | ||
return await Preferences?.clear(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters