Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
import { computed, type ComputedRef } from 'vue';
import { useWorkspaceStorage } from '@/composables/useBrowserStorage';
import type { ComposerAccount } from '@/composables/usePostComposition';
/**
* The channels the last post of this workspace was sent to, offered as a
* shortcut in the composer. Kept in this browser only.
*/
export const useLastUsedAccounts = (
accounts: () => ComposerAccount[],
): {
recentlyUsed: ComputedRef<ComposerAccount[]>;
remember: (accountIds: string[]) => void;
} => {
const ids = useWorkspaceStorage('composer.lastUsedAccounts', []);
const recentlyUsed = computed(() =>
accounts().filter((account) => ids.value.includes(account.id)),
);
const remember = (accountIds: string[]): void => {
ids.value = accountIds;
};
return { recentlyUsed, remember };
};