Move modules from "store" directory to "composables"
This commit is contained in:
parent
2fb97b985b
commit
cf23d9b8d3
41 changed files with 53 additions and 53 deletions
|
@ -7,8 +7,8 @@ import { watch } from "vue"
|
|||
import { $, $$ } from "vue/macros"
|
||||
import { useRoute } from "vue-router"
|
||||
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const route = useRoute()
|
||||
const { currentUser } = $(useCurrentUser())
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<script setup lang="ts">
|
||||
import { $ } from "vue/macros"
|
||||
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
|
||||
const { instance } = $(useInstanceInfo())
|
||||
</script>
|
||||
|
|
|
@ -271,8 +271,8 @@ import PostContent from "@/components/PostContent.vue"
|
|||
import PostEditor from "@/components/PostEditor.vue"
|
||||
import ProfileDisplayName from "@/components/ProfileDisplayName.vue"
|
||||
import VisibilityIcon from "@/components/VisibilityIcon.vue"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
import { CRYPTOCURRENCIES } from "@/utils/cryptocurrencies"
|
||||
import { getWallet } from "@/utils/ethereum"
|
||||
import { formatDateTime, humanizeDate } from "@/utils/dates"
|
||||
|
|
|
@ -9,7 +9,7 @@ import { useRouter } from "vue-router"
|
|||
|
||||
import { replaceShortcodes } from "@/api/emojis"
|
||||
import { Post } from "@/api/posts"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
import { addGreentext } from "@/utils/greentext"
|
||||
|
||||
const router = useRouter()
|
||||
|
|
|
@ -142,8 +142,8 @@ import { User } from "@/api/users"
|
|||
import Avatar from "@/components/Avatar.vue"
|
||||
import PostContent from "@/components/PostContent.vue"
|
||||
import VisibilityIcon from "@/components/VisibilityIcon.vue"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
import { setupAutoResize, triggerResize } from "@/utils/autoresize"
|
||||
import { fileToDataUrl, dataUrlToBase64 } from "@/utils/upload"
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import type { Post as PostObject } from "@/api/posts"
|
|||
import { ProfileWrapper } from "@/api/users"
|
||||
import Post from "@/components/Post.vue"
|
||||
import ProfileDisplayName from "@/components/ProfileDisplayName.vue"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
|
||||
/* eslint-disable-next-line no-undef */
|
||||
const props = defineProps<{
|
||||
|
|
|
@ -28,7 +28,7 @@ import { $computed } from "vue/macros"
|
|||
import { Profile, ProfileWrapper } from "@/api/users"
|
||||
import Avatar from "@/components/Avatar.vue"
|
||||
import ProfileDisplayName from "@/components/ProfileDisplayName.vue"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
|
||||
/* eslint-disable-next-line no-undef */
|
||||
const props = defineProps<{
|
||||
|
|
|
@ -14,7 +14,7 @@ import { $computed } from "vue/macros"
|
|||
import { Profile, ProfileWrapper } from "@/api/users"
|
||||
import Avatar from "@/components/Avatar.vue"
|
||||
import ProfileDisplayName from "@/components/ProfileDisplayName.vue"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
|
||||
const { getActorAddress } = useInstanceInfo()
|
||||
|
||||
|
|
|
@ -44,10 +44,10 @@ import { $, $computed } from "vue/macros"
|
|||
import { useRouter } from "vue-router"
|
||||
|
||||
import { Permissions } from "@/api/users"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
import { useNotifications } from "@/composables/notifications"
|
||||
import { useTheme } from "@/composables/theme"
|
||||
import { useNotifications } from "@/store/notifications"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const router = useRouter()
|
||||
const {
|
||||
|
|
|
@ -42,8 +42,8 @@ import Avatar from "@/components/Avatar.vue"
|
|||
import InstanceInfo from "@/components/InstanceInfo.vue"
|
||||
import Search from "@/components/Search.vue"
|
||||
import Sidebar from "@/components/Sidebar.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useNotifications } from "@/store/notifications"
|
||||
import { useNotifications } from "@/composables/notifications"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
|
|
@ -126,9 +126,9 @@ import {
|
|||
import Avatar from "@/components/Avatar.vue"
|
||||
import Loader from "@/components/Loader.vue"
|
||||
import ProfileDisplayName from "@/components/ProfileDisplayName.vue"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
import { useWallet } from "@/composables/wallet"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { ethereumAddressMatch } from "@/utils/ethereum"
|
||||
|
||||
/* eslint-disable-next-line no-undef */
|
||||
|
|
|
@ -132,7 +132,7 @@ import Avatar from "@/components/Avatar.vue"
|
|||
import Loader from "@/components/Loader.vue"
|
||||
import QrCode from "@/components/QrCode.vue"
|
||||
import ProfileDisplayName from "@/components/ProfileDisplayName.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
import { formatDate } from "@/utils/dates"
|
||||
import { createMoneroPaymentUri } from "@/utils/monero"
|
||||
|
||||
|
|
|
@ -103,9 +103,9 @@ import {
|
|||
import Loader from "@/components/Loader.vue"
|
||||
import ProfileListItem from "@/components/ProfileListItem.vue"
|
||||
import { useEthereumAddressVerification } from "@/composables/ethereum-address-verification"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
import { useWallet } from "@/composables/wallet"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { ethereumAddressMatch } from "@/utils/ethereum"
|
||||
|
||||
const { ensureAuthToken, ensureCurrentUser, setCurrentUser } = $(useCurrentUser())
|
||||
|
|
|
@ -70,7 +70,7 @@ import {
|
|||
getPricePerSec,
|
||||
} from "@/api/subscriptions-monero"
|
||||
import Loader from "@/components/Loader.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const router = useRouter()
|
||||
const {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { createIdentityProof, getIdentityClaim, User } from "@/api/users"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
import { getWallet, getWalletSignature } from "@/utils/ethereum"
|
||||
|
||||
async function verifyEthereumAddress(): Promise<User | null> {
|
||||
|
|
|
@ -2,7 +2,7 @@ import {
|
|||
getUnsignedUpdate,
|
||||
sendSignedActivity,
|
||||
} from "@/api/users"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
import { getWallet, getWalletSignature } from "@/utils/ethereum"
|
||||
|
||||
async function signUpdateActivity(): Promise<void> {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { ref } from "vue"
|
||||
|
||||
import { updateClientConfig } from "@/api/settings"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
import { APP_NAME } from "@/constants"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
|
||||
enum Theme {
|
||||
Light = "light",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Signer } from "ethers"
|
||||
import { ref } from "vue"
|
||||
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
import {
|
||||
getWallet,
|
||||
getWeb3Provider,
|
||||
|
|
|
@ -22,7 +22,7 @@ import SubscriptionPage from "@/views/SubscriptionPage.vue"
|
|||
import SubscriptionsSettings from "@/views/SubscriptionsSettings.vue"
|
||||
|
||||
import { Permissions } from "@/api/users"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
async function authGuard(to: any) {
|
||||
const { isAuthenticated } = useCurrentUser()
|
||||
|
|
|
@ -25,8 +25,8 @@ import { $ } from "vue/macros"
|
|||
import { APP_VERSION } from "@/constants"
|
||||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import StaticPage from "@/components/StaticPage.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
|
||||
const { currentUser } = $(useCurrentUser())
|
||||
const { instance } = $(useInstanceInfo())
|
||||
|
|
|
@ -23,7 +23,7 @@ import Loader from "@/components/Loader.vue"
|
|||
import PostEditor from "@/components/PostEditor.vue"
|
||||
import PostList from "@/components/PostList.vue"
|
||||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const router = useRouter()
|
||||
const { onInvalidAuthToken, ensureAuthToken, ensureCurrentUser } = useCurrentUser()
|
||||
|
|
|
@ -38,7 +38,7 @@ import { useRouter } from "vue-router"
|
|||
|
||||
import { createIdentityProof, getIdentityClaim } from "@/api/users"
|
||||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const router = useRouter()
|
||||
const { ensureAuthToken, currentUser } = $(useCurrentUser())
|
||||
|
|
|
@ -31,7 +31,7 @@ import { useRouter } from "vue-router"
|
|||
|
||||
import { importFollows } from "@/api/settings"
|
||||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const router = useRouter()
|
||||
const { currentUser, ensureAuthToken } = $(useCurrentUser())
|
||||
|
|
|
@ -111,8 +111,8 @@ import {
|
|||
getCurrentUser,
|
||||
} from "@/api/users"
|
||||
import Loader from "@/components/Loader.vue"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
import {
|
||||
createEip4361_SignedMessage,
|
||||
getWallet,
|
||||
|
|
|
@ -39,7 +39,7 @@ import { useRouter } from "vue-router"
|
|||
|
||||
import { moveFollowers } from "@/api/settings"
|
||||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const router = useRouter()
|
||||
const { currentUser, ensureAuthToken, setCurrentUser } = $(useCurrentUser())
|
||||
|
|
|
@ -78,9 +78,9 @@ import Avatar from "@/components/Avatar.vue"
|
|||
import Post from "@/components/Post.vue"
|
||||
import ProfileDisplayName from "@/components/ProfileDisplayName.vue"
|
||||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useNotifications } from "@/store/notifications"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
import { useNotifications } from "@/composables/notifications"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
import { humanizeDate } from "@/utils/dates"
|
||||
|
||||
const { ensureAuthToken } = useCurrentUser()
|
||||
|
|
|
@ -29,7 +29,7 @@ import { Post as PostObject, getPostThread } from "@/api/posts"
|
|||
import Loader from "@/components/Loader.vue"
|
||||
import Post from "@/components/Post.vue"
|
||||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const route = useRoute()
|
||||
const { authToken } = $(useCurrentUser())
|
||||
|
|
|
@ -61,8 +61,8 @@ import { useRoute, useRouter } from "vue-router"
|
|||
import { getTokenMetadata, TokenMetadata } from "@/api/nft"
|
||||
import { Post, getPost } from "@/api/posts"
|
||||
import Avatar from "@/components/Avatar.vue"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
import { formatDate } from "@/utils/dates"
|
||||
|
||||
const route = useRoute()
|
||||
|
|
|
@ -293,10 +293,10 @@ import ProfileDisplayName from "@/components/ProfileDisplayName.vue"
|
|||
import ProfileListItem from "@/components/ProfileListItem.vue"
|
||||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import { useEthereumAddressVerification } from "@/composables/ethereum-address-verification"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
import { useSignedActivity } from "@/composables/signed-activity"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
import { BACKEND_URL } from "@/constants"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { hasEthereumWallet } from "@/utils/ethereum"
|
||||
|
||||
const route = useRoute()
|
||||
|
|
|
@ -71,7 +71,7 @@ import { getAliases, Aliases, Profile } from "@/api/users"
|
|||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import Loader from "@/components/Loader.vue"
|
||||
import ProfileListItem from "@/components/ProfileListItem.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const { ensureCurrentUser, ensureAuthToken } = $(useCurrentUser())
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import { PAGE_SIZE } from "@/api/common"
|
|||
import { Profile, getProfiles } from "@/api/users"
|
||||
import ProfileCard from "@/components/ProfileCard.vue"
|
||||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const { ensureAuthToken } = useCurrentUser()
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ import {
|
|||
} from "@/api/users"
|
||||
import ProfileCard from "@/components/ProfileCard.vue"
|
||||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
import { setupAutoResize } from "@/utils/autoresize"
|
||||
import { fileToDataUrl, dataUrlToBase64 } from "@/utils/upload"
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import { Post, getPublicTimeline } from "@/api/posts"
|
|||
import Loader from "@/components/Loader.vue"
|
||||
import PostList from "@/components/PostList.vue"
|
||||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const { ensureAuthToken } = useCurrentUser()
|
||||
let posts = $ref<Post[]>([])
|
||||
|
|
|
@ -50,7 +50,7 @@ import Loader from "@/components/Loader.vue"
|
|||
import Post from "@/components/Post.vue"
|
||||
import ProfileListItem from "@/components/ProfileListItem.vue"
|
||||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const route = useRoute()
|
||||
const { ensureAuthToken } = useCurrentUser()
|
||||
|
|
|
@ -93,7 +93,7 @@ import { $, $ref } from "vue/macros"
|
|||
import { changePassword, exportFollowers, exportFollows } from "@/api/settings"
|
||||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import { useTheme } from "@/composables/theme"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const { currentUser, ensureAuthToken, setCurrentUser } = $(useCurrentUser())
|
||||
const { toggleDarkMode } = useTheme()
|
||||
|
|
|
@ -21,8 +21,8 @@ import {
|
|||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import SubscriptionEthereum from "@/components/SubscriptionEthereum.vue"
|
||||
import SubscriptionMonero from "@/components/SubscriptionMonero.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const route = useRoute()
|
||||
const { authToken } = $(useCurrentUser())
|
||||
|
|
|
@ -14,7 +14,7 @@ import { $, $computed } from "vue/macros"
|
|||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import SubscriptionSettingsEthereum from "@/components/SubscriptionSettingsEthereum.vue"
|
||||
import SubscriptionSettingsMonero from "@/components/SubscriptionSettingsMonero.vue"
|
||||
import { useInstanceInfo } from "@/store/instance"
|
||||
import { useInstanceInfo } from "@/composables/instance"
|
||||
|
||||
const { instance } = $(useInstanceInfo())
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import { useRoute } from "vue-router"
|
|||
import { Post, getTagTimeline } from "@/api/posts"
|
||||
import PostList from "@/components/PostList.vue"
|
||||
import SidebarLayout from "@/components/SidebarLayout.vue"
|
||||
import { useCurrentUser } from "@/store/user"
|
||||
import { useCurrentUser } from "@/composables/user"
|
||||
|
||||
const route = useRoute()
|
||||
const { authToken } = $(useCurrentUser())
|
||||
|
|
Loading…
Reference in a new issue