diff --git a/index.html b/index.html
index fda91b0f..781b0ba3 100644
--- a/index.html
+++ b/index.html
@@ -4,8 +4,6 @@
Akkoma
-
-
diff --git a/src/boot/after_store.js b/src/boot/after_store.js
index 36b087a5..d45584c0 100644
--- a/src/boot/after_store.js
+++ b/src/boot/after_store.js
@@ -322,6 +322,9 @@ const getNodeInfo = async ({ store }) => {
: federation.enabled
})
+ store.dispatch('setInstanceOption', { name: 'publicTimelineVisibility', value: metadata.publicTimelineVisibility })
+ store.dispatch('setInstanceOption', { name: 'federatedTimelineAvailable', value: metadata.federatedTimelineAvailable })
+
const accountActivationRequired = metadata.accountActivationRequired
store.dispatch('setInstanceOption', { name: 'accountActivationRequired', value: accountActivationRequired })
@@ -396,9 +399,6 @@ const afterStoreSetup = async ({ store, i18n }) => {
])
// Start fetching things that don't need to block the UI
- store.dispatch('fetchMutes')
- store.dispatch('startFetchingAnnouncements')
- store.dispatch('startFetchingReports')
getTOS({ store })
getStickers({ store })
diff --git a/src/components/desktop_nav/desktop_nav.js b/src/components/desktop_nav/desktop_nav.js
index f4900c38..d7538f5b 100644
--- a/src/components/desktop_nav/desktop_nav.js
+++ b/src/components/desktop_nav/desktop_nav.js
@@ -1,6 +1,11 @@
import SearchBar from 'components/search_bar/search_bar.vue'
import ConfirmModal from '../confirm_modal/confirm_modal.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
+import {
+ publicTimelineVisible,
+ federatedTimelineVisible,
+ bubbleTimelineVisible,
+} from '../../lib/timeline_visibility'
import {
faSignInAlt,
faSignOutAlt,
@@ -19,6 +24,7 @@ import {
faInfoCircle,
faUserTie
} from '@fortawesome/free-solid-svg-icons'
+import { mapState } from 'vuex'
library.add(
faSignInAlt,
@@ -103,7 +109,12 @@ export default {
},
showBubbleTimeline () {
return this.$store.state.instance.localBubbleInstances.length > 0
- }
+ },
+ ...mapState({
+ publicTimelineVisible,
+ federatedTimelineVisible,
+ bubbleTimelineVisible,
+ })
},
methods: {
scrollToTop () {
diff --git a/src/components/desktop_nav/desktop_nav.vue b/src/components/desktop_nav/desktop_nav.vue
index 92d3fa5b..f50d1b3e 100644
--- a/src/components/desktop_nav/desktop_nav.vue
+++ b/src/components/desktop_nav/desktop_nav.vue
@@ -46,6 +46,7 @@
@@ -69,6 +70,7 @@
state.users.currentUser,
privateMode: state => state.instance.private,
- federating: state => state.instance.federating
+ federating: state => state.instance.federating,
}),
...mapGetters(['unreadAnnouncementCount']),
followRequestCount () {
diff --git a/src/components/poll/poll_form.js b/src/components/poll/poll_form.js
index e30645c3..89f01eb4 100644
--- a/src/components/poll/poll_form.js
+++ b/src/components/poll/poll_form.js
@@ -103,9 +103,9 @@ export default {
convertExpiryFromUnit (unit, amount) {
// Note: we want seconds and not milliseconds
switch (unit) {
- case 'minutes': return 0.001 * amount * DateUtils.MINUTE
- case 'hours': return 0.001 * amount * DateUtils.HOUR
- case 'days': return 0.001 * amount * DateUtils.DAY
+ case 'minutes': return amount * DateUtils.MINUTE / 1000
+ case 'hours': return amount * DateUtils.HOUR / 1000
+ case 'days': return amount * DateUtils.DAY / 1000
}
},
expiryAmountChange () {
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index f7fef499..5647a9eb 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -169,31 +169,33 @@ const PostStatusForm = {
}
}
- let draftKey = 'status';
- if (this.replyTo) {
- draftKey = 'reply:' + this.replyTo;
- } else if (this.quoteId) {
- draftKey = 'quote:' + this.quoteId;
- }
-
- const draft = JSON.parse(localStorage.getItem('drafts') || '{}')[draftKey];
-
- if (draft) {
- statusParams = {
- spoilerText: draft.data.spoilerText,
- status: draft.data.status,
- sensitiveIfSubject,
- nsfw: draft.data.nsfw,
- files: draft.data.files,
- poll: draft.data.poll,
- mediaDescriptions: draft.data.mediaDescriptions,
- visibility: draft.data.visibility,
- language: draft.data.language,
- contentType: draft.data.contentType
+ if (!this.statusId) {
+ let draftKey = 'status';
+ if (this.replyTo) {
+ draftKey = 'reply:' + this.replyTo;
+ } else if (this.quoteId) {
+ draftKey = 'quote:' + this.quoteId;
}
- if (draft.data.poll) {
- this.togglePollForm();
+ const draft = JSON.parse(localStorage.getItem('drafts') || '{}')[draftKey];
+
+ if (draft) {
+ statusParams = {
+ spoilerText: draft.data.spoilerText,
+ status: draft.data.status,
+ sensitiveIfSubject,
+ nsfw: draft.data.nsfw,
+ files: draft.data.files,
+ poll: draft.data.poll,
+ mediaDescriptions: draft.data.mediaDescriptions,
+ visibility: draft.data.visibility,
+ language: draft.data.language,
+ contentType: draft.data.contentType
+ }
+
+ if (draft.data.poll) {
+ this.togglePollForm();
+ }
}
}
diff --git a/src/components/rich_content/rich_content.jsx b/src/components/rich_content/rich_content.jsx
index c5fb1688..0da7f3de 100644
--- a/src/components/rich_content/rich_content.jsx
+++ b/src/components/rich_content/rich_content.jsx
@@ -188,7 +188,7 @@ export default {
break
}
case 'span':
- if (this.handleLinks && attrs['class'] && attrs['class'].includes('h-card')) {
+ if (this.handleLinks && attrs?.['class']?.includes?.('h-card')) {
return ['', children.map(processItem), '']
}
}
diff --git a/src/components/timeline_menu/timeline_menu_content.js b/src/components/timeline_menu/timeline_menu_content.js
index df15030b..80cf6937 100644
--- a/src/components/timeline_menu/timeline_menu_content.js
+++ b/src/components/timeline_menu/timeline_menu_content.js
@@ -8,6 +8,7 @@ import {
faHome,
faCircle
} from '@fortawesome/free-solid-svg-icons'
+import { federatedTimelineVisible, publicTimelineVisible, bubbleTimelineVisible } from '../../lib/timeline_visibility'
library.add(
faUsers,
@@ -24,7 +25,9 @@ const TimelineMenuContent = {
currentUser: state => state.users.currentUser,
privateMode: state => state.instance.private,
federating: state => state.instance.federating,
- showBubbleTimeline: state => (state.instance.localBubbleInstances.length > 0)
+ publicTimelineVisible,
+ federatedTimelineVisible,
+ bubbleTimelineVisible,
})
}
}
diff --git a/src/components/timeline_menu/timeline_menu_content.vue b/src/components/timeline_menu/timeline_menu_content.vue
index 27aece22..bb170b82 100644
--- a/src/components/timeline_menu/timeline_menu_content.vue
+++ b/src/components/timeline_menu/timeline_menu_content.vue
@@ -16,7 +16,7 @@
>{{ $t("nav.home_timeline") }}
-
+
-
+
-
+
diff --git a/src/components/timeline_menu_tabs/timeline_menu_content.js b/src/components/timeline_menu_tabs/timeline_menu_content.js
index 9c2ef0c9..00df2120 100644
--- a/src/components/timeline_menu_tabs/timeline_menu_content.js
+++ b/src/components/timeline_menu_tabs/timeline_menu_content.js
@@ -8,6 +8,7 @@ import {
faHome
} from '@fortawesome/free-solid-svg-icons'
import { faCircle } from '@fortawesome/free-regular-svg-icons'
+import { federatedTimelineVisible, publicTimelineVisible, bubbleTimelineVisible } from '../../lib/timeline_visibility'
library.add(
faUsers,
faGlobe,
@@ -22,7 +23,10 @@ const TimelineMenuContent = {
...mapState({
currentUser: state => state.users.currentUser,
privateMode: state => state.instance.private,
- federating: state => state.instance.federating
+ federating: state => state.instance.federating,
+ publicTimelineVisible,
+ federatedTimelineVisible,
+ bubbleTimelineVisible,
})
}
}
diff --git a/src/components/timeline_menu_tabs/timeline_menu_content.vue b/src/components/timeline_menu_tabs/timeline_menu_content.vue
index 32548c49..28e58714 100644
--- a/src/components/timeline_menu_tabs/timeline_menu_content.vue
+++ b/src/components/timeline_menu_tabs/timeline_menu_content.vue
@@ -16,7 +16,7 @@
>{{ $t("nav.home_timeline") }}
-
+
-
+
-
+