refactor store

This commit is contained in:
pa
2026-03-10 13:55:03 +09:00
parent 2fffadfbcf
commit d7220baaf6
47 changed files with 1993 additions and 1750 deletions
+7 -8
View File
@@ -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
};
});