remove references to vuex
This commit is contained in:
parent
5b9027f17a
commit
7ae22bbb75
10 changed files with 3 additions and 29 deletions
|
|
@ -71,7 +71,6 @@ const chatNew = {
|
||||||
|
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.userIds = []
|
this.userIds = []
|
||||||
this.$store
|
|
||||||
useSearchStore()
|
useSearchStore()
|
||||||
.search({ q: query, resolve: true, type: 'accounts' })
|
.search({ q: query, resolve: true, type: 'accounts' })
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ const EditStatusForm = {
|
||||||
},
|
},
|
||||||
doEditStatus({ status, spoilerText, sensitive, media, contentType, poll }) {
|
doEditStatus({ status, spoilerText, sensitive, media, contentType, poll }) {
|
||||||
const params = {
|
const params = {
|
||||||
store: this.$store,
|
|
||||||
statusId: this.params.statusId,
|
statusId: this.params.statusId,
|
||||||
status,
|
status,
|
||||||
spoilerText,
|
spoilerText,
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,6 @@ const mediaUpload = {
|
||||||
},
|
},
|
||||||
async uploadFile(file) {
|
async uploadFile(file) {
|
||||||
const self = this
|
const self = this
|
||||||
const store = this.$store
|
|
||||||
if (file.size > useInstanceStore().uploadlimit) {
|
if (file.size > useInstanceStore().uploadlimit) {
|
||||||
const filesize = fileSizeFormatService.fileSizeFormat(file.size)
|
const filesize = fileSizeFormatService.fileSizeFormat(file.size)
|
||||||
const allowedsize = fileSizeFormatService.fileSizeFormat(
|
const allowedsize = fileSizeFormatService.fileSizeFormat(
|
||||||
|
|
@ -145,7 +144,7 @@ const mediaUpload = {
|
||||||
self.$emit('uploading')
|
self.$emit('uploading')
|
||||||
self.uploadCount++
|
self.uploadCount++
|
||||||
|
|
||||||
statusPosterService.uploadMedia({ store, formData }).then(
|
statusPosterService.uploadMedia({ formData }).then(
|
||||||
(fileData) => {
|
(fileData) => {
|
||||||
self.$emit('uploaded', fileData)
|
self.$emit('uploaded', fileData)
|
||||||
self.decreaseUploadCount()
|
self.decreaseUploadCount()
|
||||||
|
|
|
||||||
|
|
@ -401,8 +401,6 @@ const PostStatusForm = {
|
||||||
contentType: this.newStatus.contentType,
|
contentType: this.newStatus.contentType,
|
||||||
poll,
|
poll,
|
||||||
idempotencyKey: this.idempotencyKey,
|
idempotencyKey: this.idempotencyKey,
|
||||||
|
|
||||||
store: this.$store,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -413,7 +411,6 @@ const PostStatusForm = {
|
||||||
...useEmojiStore().standardEmojiList,
|
...useEmojiStore().standardEmojiList,
|
||||||
...useEmojiStore().customEmoji,
|
...useEmojiStore().customEmoji,
|
||||||
],
|
],
|
||||||
store: this.$store,
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
emojiSuggestor() {
|
emojiSuggestor() {
|
||||||
|
|
@ -575,7 +572,7 @@ const PostStatusForm = {
|
||||||
...mapState(useUsersStore, ['currentUser']),
|
...mapState(useUsersStore, ['currentUser']),
|
||||||
...mapState(useMergedConfigStore, ['mergedConfig']),
|
...mapState(useMergedConfigStore, ['mergedConfig']),
|
||||||
...mapState(useInterfaceStore, {
|
...mapState(useInterfaceStore, {
|
||||||
mobileLayout: (store) => store.mobileLayout,
|
mobileLayout: (state) => state.mobileLayout,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -752,7 +749,6 @@ const PostStatusForm = {
|
||||||
const description = this.newStatus.mediaDescriptions[id]
|
const description = this.newStatus.mediaDescriptions[id]
|
||||||
if (!description || description.trim() === '') return
|
if (!description || description.trim() === '') return
|
||||||
return statusPoster.setMediaDescription({
|
return statusPoster.setMediaDescription({
|
||||||
store: this.$store,
|
|
||||||
id,
|
id,
|
||||||
description,
|
description,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -97,9 +97,6 @@ const StatusActionButtons = {
|
||||||
replying: this.replying,
|
replying: this.replying,
|
||||||
emojiPickerShown: this.emojiPickerShown,
|
emojiPickerShown: this.emojiPickerShown,
|
||||||
emit: this.$emit,
|
emit: this.$emit,
|
||||||
dispatch: this.$store.dispatch,
|
|
||||||
state: this.$store.state,
|
|
||||||
getters: this.$store.getters,
|
|
||||||
router: this.$router,
|
router: this.$router,
|
||||||
currentUser: this.currentUser,
|
currentUser: this.currentUser,
|
||||||
loggedIn: !!this.currentUser,
|
loggedIn: !!this.currentUser,
|
||||||
|
|
|
||||||
|
|
@ -29,14 +29,13 @@ const StickerPicker = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pick(sticker, name) {
|
pick(sticker, name) {
|
||||||
const store = this.$store
|
|
||||||
// TODO remove this workaround by finding a way to bypass reuploads
|
// TODO remove this workaround by finding a way to bypass reuploads
|
||||||
fetch(sticker).then((res) => {
|
fetch(sticker).then((res) => {
|
||||||
res.blob().then((blob) => {
|
res.blob().then((blob) => {
|
||||||
const file = new File([blob], name, { mimetype: 'image/png' })
|
const file = new File([blob], name, { mimetype: 'image/png' })
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append('file', file)
|
formData.append('file', file)
|
||||||
statusPosterService.uploadMedia({ store, formData }).then(
|
statusPosterService.uploadMedia({ formData }).then(
|
||||||
(fileData) => {
|
(fileData) => {
|
||||||
this.$emit('uploaded', fileData)
|
this.$emit('uploaded', fileData)
|
||||||
this.clear()
|
this.clear()
|
||||||
|
|
|
||||||
|
|
@ -418,7 +418,6 @@ export default {
|
||||||
...useEmojiStore().standardEmojiList,
|
...useEmojiStore().standardEmojiList,
|
||||||
...useEmojiStore().customEmoji,
|
...useEmojiStore().customEmoji,
|
||||||
],
|
],
|
||||||
store: this.$store,
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
emojiSuggestor() {
|
emojiSuggestor() {
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,6 @@ const persistedStateOptions = {
|
||||||
strict: false, // Socket modifies itself, let's ignore this for now.
|
strict: false, // Socket modifies itself, let's ignore this for now.
|
||||||
// strict: process.env.NODE_ENV !== 'production'
|
// strict: process.env.NODE_ENV !== 'production'
|
||||||
})
|
})
|
||||||
window.vuex = store
|
|
||||||
// Temporarily passing pinia and vuex stores along with storageError result until migration is fully complete.
|
// Temporarily passing pinia and vuex stores along with storageError result until migration is fully complete.
|
||||||
return await afterStoreSetup({ pinia, store, storageError, i18n })
|
return await afterStoreSetup({ pinia, store, storageError, i18n })
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
|
|
@ -612,13 +612,6 @@ export const useUsersStore = defineStore('users', {
|
||||||
|
|
||||||
// Login/Logout
|
// Login/Logout
|
||||||
async loginUser(accessToken) {
|
async loginUser(accessToken) {
|
||||||
const store = window.vuex
|
|
||||||
const dispatch =
|
|
||||||
store?.dispatch ??
|
|
||||||
(() => {
|
|
||||||
/* no-op */
|
|
||||||
}) // for tests
|
|
||||||
|
|
||||||
this.loggingIn = true
|
this.loggingIn = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -723,7 +716,6 @@ export const useUsersStore = defineStore('users', {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
logout() {
|
logout() {
|
||||||
const store = window.vuex
|
|
||||||
const oauth = useOAuthStore()
|
const oauth = useOAuthStore()
|
||||||
|
|
||||||
// Pause fetching
|
// Pause fetching
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,6 @@ const message3 = {
|
||||||
|
|
||||||
const global = {
|
const global = {
|
||||||
mocks: {
|
mocks: {
|
||||||
$store: {
|
|
||||||
state: {
|
|
||||||
api: {},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
$route: {
|
$route: {
|
||||||
params: {
|
params: {
|
||||||
recipient_id: 2,
|
recipient_id: 2,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue