Skip to content

Commit d969920

Browse files
committed
docs: update to use @capacitor/preferences
1 parent 54cf71d commit d969920

3 files changed

Lines changed: 21 additions & 21 deletions

File tree

‎playground/composables/usePhotoGallery.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import{Capacitor}from'@capacitor/core'
22
import{Camera,CameraSource,CameraResultType,Photo}from'@capacitor/camera'
33
import{Filesystem,Directory}from'@capacitor/filesystem'
4-
import{Storage}from'@capacitor/storage'
4+
import{Preferences}from'@capacitor/preferences'
55

66
exportfunctionusePhotoGallery(){
77
constphotos=ref<UserPhoto[]>([])
88
constPHOTO_STORAGE='photos'
99

1010
constloadSaved=async()=>{
11-
constphotoList=awaitStorage.get({key: PHOTO_STORAGE})
11+
constphotoList=awaitPreferences.get({key: PHOTO_STORAGE})
1212
constphotosInStorage=photoList.value ? JSON.parse(photoList.value) : []
1313

1414
// If running on the web...
@@ -100,7 +100,7 @@ export function usePhotoGallery() {
100100
}
101101

102102
constcachePhotos=()=>{
103-
Storage.set({
103+
Preferences.set({
104104
key: PHOTO_STORAGE,
105105
value: JSON.stringify(photos.value),
106106
})

‎playground/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"devDependencies": {
1111
"@capacitor/camera": "5.0.8",
1212
"@capacitor/filesystem": "5.2.0",
13-
"@capacitor/storage": "1.2.5",
13+
"@capacitor/preferences": "5.0.6",
1414
"@nuxtjs/ionic": "latest",
1515
"nuxt": "3.6.5"
1616
}

‎pnpm-lock.yaml‎

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)