mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-03 21:36:06 +02:00
refactor store
This commit is contained in:
+7
-8
@@ -3,8 +3,6 @@ import { defineStore } from 'pinia';
|
||||
|
||||
import { database } from '../service/database';
|
||||
import { useFriendStore } from './friend';
|
||||
import { useNotificationStore } from './notification';
|
||||
import { useSharedFeedStore } from './sharedFeed';
|
||||
import { useVrcxStore } from './vrcx';
|
||||
import { watchState } from '../service/watchState';
|
||||
|
||||
@@ -12,9 +10,7 @@ import configRepository from '../service/config';
|
||||
|
||||
export const useFeedStore = defineStore('Feed', () => {
|
||||
const friendStore = useFriendStore();
|
||||
const notificationStore = useNotificationStore();
|
||||
const vrcxStore = useVrcxStore();
|
||||
const sharedFeedStore = useSharedFeedStore();
|
||||
|
||||
const feedTableData = shallowRef([]);
|
||||
const feedTable = ref({
|
||||
@@ -170,9 +166,12 @@ export const useFeedStore = defineStore('Feed', () => {
|
||||
}
|
||||
}
|
||||
|
||||
function addFeed(feed) {
|
||||
notificationStore.queueFeedNoty(feed);
|
||||
sharedFeedStore.addEntry(feed);
|
||||
/**
|
||||
* Appends a feed entry to the local table if it passes filters.
|
||||
* Does NOT trigger notifications or shared feed — that is the caller's responsibility.
|
||||
* @param {object} feed The feed entry to add.
|
||||
*/
|
||||
function addFeedEntry(feed) {
|
||||
if (
|
||||
feedTable.value.filter.length > 0 &&
|
||||
!feedTable.value.filter.includes(feed.type)
|
||||
@@ -222,6 +221,6 @@ export const useFeedStore = defineStore('Feed', () => {
|
||||
feedTableData,
|
||||
initFeedTable,
|
||||
feedTableLookup,
|
||||
addFeed
|
||||
addFeedEntry
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user