Skip to content

Commit

Permalink
fix: stories not appearing
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyri1 committed Feb 23, 2023
1 parent caf7d5a commit b0d6976
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
2 changes: 2 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
platforms:
android:
versionName: 0.3.13
incrementVersionCode: true
manifest:
- file: AndroidManifest.xml
target: manifest/application
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bah",
"version": "0.3.11",
"version": "0.3.13",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
6 changes: 1 addition & 5 deletions src/data/storiesIndex.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
import { useStoryStore } from '../stores/StoryStores';

export async function storiesIndex() {
const storyStore = useStoryStore();
const directory = Directory.Documents;
var jsonStories = [];
var errors = [];
Expand Down Expand Up @@ -73,9 +71,7 @@ export async function storiesIndex() {
try {
var jsonStory = await JSON.parse(readStoryJson.data);
jsonStory['name'] = storyDir.name;
if(!storyStore.unfavoriteStories.includes(storyDir.name)) { // remove unfav
jsonStories.push(jsonStory);
}
jsonStories.push(jsonStory);
} catch (err) {
errors.push(
'Le fichier story.json de l\'histoire "' +
Expand Down
19 changes: 13 additions & 6 deletions src/stores/StoryStores.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ export const useStoryStore = defineStore('StoryStore', {
storiesIndex()
.then((result) => {
if (result.errors) {
console.log(result.data);
this.errors = result.data;
} else {
this.stories = result.data;
var arr = this.unfavoriteStories;
var filteredData = result.data.filter(function (el) {
return !arr.includes(el.name);
});
this.stories = filteredData;
}
})
.then(() => {
Expand Down Expand Up @@ -70,16 +73,20 @@ export const useStoryStore = defineStore('StoryStore', {
} else {
this.theme = result.value;
}
})
});
Preferences.get({ key: 'timelineVisible' }).then((result) => {
if (result.value === null) {
this.timelineVisible = false
this.timelineVisible = false;
} else {
this.timelineVisible = JSON.parse(result.value.toLowerCase())
this.timelineVisible = JSON.parse(result.value.toLowerCase());
}
});
Preferences.get({ key: 'unfavoriteStories' }).then((result) => {
this.unfavoriteStories = JSON.parse(result.value)
if (result.value === null) {
this.unfavoriteStories = [];
} else {
this.unfavoriteStories = JSON.parse(result.value);
}
});
},
async loadUnofficialStoreData() {
Expand Down

0 comments on commit b0d6976

Please sign in to comment.