-
-
-
- {{ group.text }}
-
-
- {{ emoji.replacement }}
-
-
-
-
-
+
{
+ 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 d9c568f6..599611b2 100644
--- a/src/components/emoji_reactions/emoji_reactions.vue
+++ b/src/components/emoji_reactions/emoji_reactions.vue
@@ -18,7 +18,7 @@
:src="reaction.url"
:title="reaction.name"
class="reaction-emoji"
- width="2.55em"
+ height="2.55em"
>
{{ reaction.count }}
@@ -49,6 +49,7 @@
display: flex;
margin-top: 0.25em;
flex-wrap: wrap;
+ container-type: inline-size;
}
.unicode-emoji {
@@ -64,7 +65,9 @@
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;
}
&:focus {
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/follow_request_card/follow_request_card.js b/src/components/follow_request_card/follow_request_card.js
index b0873bb1..47c86e15 100644
--- a/src/components/follow_request_card/follow_request_card.js
+++ b/src/components/follow_request_card/follow_request_card.js
@@ -43,6 +43,7 @@ const FollowRequestCard = {
doApprove () {
this.$store.state.api.backendInteractor.approveUser({ id: this.user.id })
this.$store.dispatch('removeFollowRequest', this.user)
+ this.$store.dispatch('decrementFollowRequestsCount')
const notifId = this.findFollowRequestNotificationId()
this.$store.dispatch('markSingleNotificationAsSeen', { id: notifId })
@@ -66,6 +67,7 @@ const FollowRequestCard = {
this.$store.state.api.backendInteractor.denyUser({ id: this.user.id })
.then(() => {
this.$store.dispatch('dismissNotificationLocal', { id: notifId })
+ this.$store.dispatch('decrementFollowRequestsCount')
this.$store.dispatch('removeFollowRequest', this.user)
})
this.hideDenyConfirmDialog()
@@ -80,6 +82,11 @@ const FollowRequestCard = {
},
shouldConfirmDeny () {
return this.mergedConfig.modalOnDenyFollow
+ },
+ show () {
+ const notifId = this.$store.state.api.followRequests.find(req => req.id === this.user.id)
+
+ return notifId !== undefined
}
}
}
diff --git a/src/components/follow_request_card/follow_request_card.vue b/src/components/follow_request_card/follow_request_card.vue
index 835471e7..80445021 100644
--- a/src/components/follow_request_card/follow_request_card.vue
+++ b/src/components/follow_request_card/follow_request_card.vue
@@ -1,5 +1,5 @@
-
+
-
+
+
+
+
+
diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js
index af165d47..991cee1c 100644
--- a/src/components/nav_panel/nav_panel.js
+++ b/src/components/nav_panel/nav_panel.js
@@ -33,11 +33,6 @@ library.add(
)
const NavPanel = {
- created () {
- if (this.currentUser && this.currentUser.locked) {
- this.$store.dispatch('startFetchingFollowRequests')
- }
- },
components: {
TimelineMenuContent
},
@@ -54,11 +49,13 @@ const NavPanel = {
computed: {
...mapState({
currentUser: state => state.users.currentUser,
- followRequestCount: state => state.api.followRequests.length,
privateMode: state => state.instance.private,
- federating: state => state.instance.federating
+ federating: state => state.instance.federating,
}),
- ...mapGetters(['unreadAnnouncementCount'])
+ ...mapGetters(['unreadAnnouncementCount']),
+ followRequestCount () {
+ return this.$store.state.users.currentUser.follow_requests_count
+ }
}
}
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index b7c66fc7..f7fef499 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,34 @@ 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 (draft.data.poll) {
+ this.togglePollForm();
+ }
+ }
+
return {
dropFiles: [],
uploadingFiles: false,
@@ -280,6 +316,7 @@ const PostStatusForm = {
statusChanged () {
this.autoPreview()
this.updateIdempotencyKey()
+ this.saveDraft()
},
clearStatus () {
const newStatus = this.newStatus
@@ -401,8 +438,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.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..ab277d74 100644
--- a/src/components/timeline_menu/timeline_menu_content.js
+++ b/src/components/timeline_menu/timeline_menu_content.js
@@ -24,7 +24,8 @@ const TimelineMenuContent = {
currentUser: state => state.users.currentUser,
privateMode: state => state.instance.private,
federating: state => state.instance.federating,
- showBubbleTimeline: state => (state.instance.localBubbleInstances.length > 0)
+ showBubbleTimeline: state => (state.instance.localBubbleInstances.length > 0),
+ publicTimelineVisibility: state => state.instance.publicTimelineVisibility,
})
}
}
diff --git a/src/components/timeline_menu/timeline_menu_content.vue b/src/components/timeline_menu/timeline_menu_content.vue
index 27aece22..0144f2fd 100644
--- a/src/components/timeline_menu/timeline_menu_content.vue
+++ b/src/components/timeline_menu/timeline_menu_content.vue
@@ -32,7 +32,7 @@
>{{ $t("nav.bubble_timeline") }}