diff --git a/index.html b/index.html
index e2641312..ba6c8651 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 0f95237c..30d46da9 100644
--- a/src/boot/after_store.js
+++ b/src/boot/after_store.js
@@ -324,6 +324,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 })
@@ -398,9 +401,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 @@
{
+ const allEmojis = state.instance.emoji.concat(state.instance.customEmoji)
+ return allEmojis.find(emoji => emoji.replacement === replacement)
+}
+
const EmojiReactions = {
name: 'EmojiReactions',
components: {
@@ -54,6 +59,8 @@ const EmojiReactions = {
},
reactWith (emoji) {
this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji })
+ const emojiObject = findEmojiByReplacement(this.$store.state, emoji)
+ this.$store.commit('emojiUsed', emojiObject)
},
unreact (emoji) {
this.$store.dispatch('unreactWithEmoji', { id: this.status.id, emoji })
diff --git a/src/components/emoji_reactions/emoji_reactions.vue b/src/components/emoji_reactions/emoji_reactions.vue
index 3fe81f77..599611b2 100644
--- a/src/components/emoji_reactions/emoji_reactions.vue
+++ b/src/components/emoji_reactions/emoji_reactions.vue
@@ -18,7 +18,6 @@
:src="reaction.url"
:title="reaction.name"
class="reaction-emoji"
- width="2.55em"
height="2.55em"
>
{{ reaction.count }}
@@ -50,6 +49,7 @@
display: flex;
margin-top: 0.25em;
flex-wrap: wrap;
+ container-type: inline-size;
}
.unicode-emoji {
@@ -65,7 +65,8 @@
justify-content: center;
box-sizing: border-box;
.reaction-emoji {
- width: 2.55em !important;
+ width: auto;
+ max-width: 96cqw;
height: 2.55em !important;
margin-right: 0.25em;
}
diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js
index 5eb98264..14c605fb 100644
--- a/src/components/extra_buttons/extra_buttons.js
+++ b/src/components/extra_buttons/extra_buttons.js
@@ -15,6 +15,7 @@ import {
faBookmark as faBookmarkReg,
faFlag
} from '@fortawesome/free-regular-svg-icons'
+import { mapState } from 'vuex'
library.add(
faEllipsisH,
@@ -191,7 +192,7 @@ const ExtraButtons = {
isEdited () {
return this.status.edited_at !== null
},
- editingAvailable () { return this.$store.state.instance.editingAvailable }
+ editingAvailable () { return this.$store.state.instance.editingAvailable },
}
}
diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js
index e63be37e..13c22924 100644
--- a/src/components/nav_panel/nav_panel.js
+++ b/src/components/nav_panel/nav_panel.js
@@ -53,7 +53,7 @@ const NavPanel = {
...mapState({
currentUser: state => 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 b8539395..8558d45d 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -54,6 +54,14 @@ const pxStringToNumber = (str) => {
return Number(str.substring(0, str.length - 2))
}
+const deleteDraft = (draftKey) => {
+ const draftData = JSON.parse(localStorage.getItem('drafts') || '{}');
+
+ delete draftData[draftKey];
+
+ localStorage.setItem('drafts', JSON.stringify(draftData));
+}
+
const PostStatusForm = {
props: [
'statusId',
@@ -161,6 +169,36 @@ const PostStatusForm = {
}
}
+ if (!this.statusId) {
+ 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 (draft.data.poll) {
+ this.togglePollForm();
+ }
+ }
+ }
+
return {
dropFiles: [],
uploadingFiles: false,
@@ -280,6 +318,7 @@ const PostStatusForm = {
statusChanged () {
this.autoPreview()
this.updateIdempotencyKey()
+ this.saveDraft()
},
clearStatus () {
const newStatus = this.newStatus
@@ -401,8 +440,38 @@ const PostStatusForm = {
}).finally(() => {
this.previewLoading = false
})
+
+ let draftKey = 'status';
+ if (this.replyTo) {
+ draftKey = 'reply:' + this.replyTo;
+ } else if (this.quoteId) {
+ draftKey = 'quote:' + this.quoteId;
+ }
+ deleteDraft(draftKey)
},
debouncePreviewStatus: debounce(function () { this.previewStatus() }, 500),
+ saveDraft() {
+ const draftData = JSON.parse(localStorage.getItem('drafts') || '{}');
+
+ let draftKey = 'status';
+ if (this.replyTo) {
+ draftKey = 'reply:' + this.replyTo;
+ } else if (this.quoteId) {
+ draftKey = 'quote:' + this.quoteId;
+ }
+
+ if (this.newStatus.status || this.newStatus.spoilerText || this.newStatus.files.length > 0 || this.newStatus.poll.length > 0) {
+ draftData[draftKey] = {
+ updatedAt: new Date(),
+ data: this.newStatus,
+ };
+
+ localStorage.setItem('drafts', JSON.stringify(draftData));
+
+ } else {
+ deleteDraft(draftKey);
+ }
+ },
autoPreview () {
if (!this.preview) return
this.previewLoading = true
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/rich_content/rich_content.scss b/src/components/rich_content/rich_content.scss
index db08ef1e..63df7d74 100644
--- a/src/components/rich_content/rich_content.scss
+++ b/src/components/rich_content/rich_content.scss
@@ -50,7 +50,6 @@
.emoji {
display: inline-block;
- width: var(--emoji-size, 32px);
height: var(--emoji-size, 32px);
}
diff --git a/src/components/status_body/status_body.scss b/src/components/status_body/status_body.scss
index 230a27ac..d618f65e 100644
--- a/src/components/status_body/status_body.scss
+++ b/src/components/status_body/status_body.scss
@@ -22,21 +22,18 @@
._mfm_x2_ {
.emoji {
- width: 100px;
height: 100px;
}
}
._mfm_x3_ {
.emoji {
- width: 150px;
height: 150px;
}
}
._mfm_x4_ {
.emoji {
- width: 200px;
height: 200px;
}
}
diff --git a/src/components/status_content/status_content.vue b/src/components/status_content/status_content.vue
index ab13141e..62acf5ac 100644
--- a/src/components/status_content/status_content.vue
+++ b/src/components/status_content/status_content.vue
@@ -71,7 +71,7 @@
img, video {
&.emoji {
- width: 50px;
+ max-width: 100%;
height: 50px;
}
}
@@ -89,7 +89,6 @@
animation: none !important;
}
.emoji {
- width: 32px !important;
height: 32px !important;
}
}
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") }}
-
+
-
+
-
+