From 782684537edc4bd0dcf4b033e43ccb1fee82664f Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Thu, 30 Dec 2021 00:42:55 +0900
Subject: [PATCH] refs #2856 Hide medias in notifications when the setting is
enabled
---
.../components/organisms/Notification/Favourite.vue | 11 ++++++-----
.../components/organisms/Notification/PollExpired.vue | 11 ++++++-----
.../components/organisms/Notification/PollVote.vue | 11 ++++++-----
.../components/organisms/Notification/Quote.vue | 9 +++++----
.../components/organisms/Notification/Reaction.vue | 11 ++++++-----
.../components/organisms/Notification/Reblog.vue | 9 +++++----
6 files changed, 34 insertions(+), 28 deletions(-)
diff --git a/src/renderer/components/organisms/Notification/Favourite.vue b/src/renderer/components/organisms/Notification/Favourite.vue
index c9e8a009..a3cd12c8 100644
--- a/src/renderer/components/organisms/Notification/Favourite.vue
+++ b/src/renderer/components/organisms/Notification/Favourite.vue
@@ -153,10 +153,11 @@ export default {
}
},
computed: {
- ...mapState({
- displayNameStyle: state => state.App.displayNameStyle,
- timeFormat: state => state.App.timeFormat,
- language: state => state.App.language
+ ...mapState('App', {
+ displayNameStyle: state => state.displayNameStyle,
+ timeFormat: state => state.timeFormat,
+ language: state => state.language,
+ hideAllAttachments: state => state.hideAllAttachments
}),
shortcutEnabled: function () {
return this.focused && !this.overlaid
@@ -251,7 +252,7 @@ export default {
return !this.spoilered(message) || this.showContent
},
sensitive(message) {
- return message.sensitive && this.mediaAttachments(message).length > 0
+ return (this.hideAllAttachments || message.sensitive) && this.mediaAttachments(message).length > 0
},
isShowAttachments(message) {
return !this.sensitive(message) || this.showAttachments
diff --git a/src/renderer/components/organisms/Notification/PollExpired.vue b/src/renderer/components/organisms/Notification/PollExpired.vue
index 29dce8e7..3c78fa84 100644
--- a/src/renderer/components/organisms/Notification/PollExpired.vue
+++ b/src/renderer/components/organisms/Notification/PollExpired.vue
@@ -153,10 +153,11 @@ export default {
}
},
computed: {
- ...mapState({
- displayNameStyle: state => state.App.displayNameStyle,
- timeFormat: state => state.App.timeFormat,
- language: state => state.App.language
+ ...mapState('App', {
+ displayNameStyle: state => state.displayNameStyle,
+ timeFormat: state => state.timeFormat,
+ language: state => state.language,
+ hideAllAttachments: state => state.hideAllAttachments
}),
shortcutEnabled: function () {
return this.focused && !this.overlaid
@@ -251,7 +252,7 @@ export default {
return !this.spoilered(message) || this.showContent
},
sensitive(message) {
- return message.sensitive && this.mediaAttachments(message).length > 0
+ return (this.hideAllAttachments || message.sensitive) && this.mediaAttachments(message).length > 0
},
isShowAttachments(message) {
return !this.sensitive(message) || this.showAttachments
diff --git a/src/renderer/components/organisms/Notification/PollVote.vue b/src/renderer/components/organisms/Notification/PollVote.vue
index 181831e3..93402e4b 100644
--- a/src/renderer/components/organisms/Notification/PollVote.vue
+++ b/src/renderer/components/organisms/Notification/PollVote.vue
@@ -153,10 +153,11 @@ export default {
}
},
computed: {
- ...mapState({
- displayNameStyle: state => state.App.displayNameStyle,
- timeFormat: state => state.App.timeFormat,
- language: state => state.App.language
+ ...mapState('App', {
+ displayNameStyle: state => state.displayNameStyle,
+ timeFormat: state => state.timeFormat,
+ language: state => state.language,
+ hideAllAttachments: state => state.hideAllAttachments
}),
shortcutEnabled: function () {
return this.focused && !this.overlaid
@@ -251,7 +252,7 @@ export default {
return !this.spoilered(message) || this.showContent
},
sensitive(message) {
- return message.sensitive && this.mediaAttachments(message).length > 0
+ return (this.hideAllAttachments || message.sensitive) && this.mediaAttachments(message).length > 0
},
isShowAttachments(message) {
return !this.sensitive(message) || this.showAttachments
diff --git a/src/renderer/components/organisms/Notification/Quote.vue b/src/renderer/components/organisms/Notification/Quote.vue
index faef62d6..1dee6a3c 100644
--- a/src/renderer/components/organisms/Notification/Quote.vue
+++ b/src/renderer/components/organisms/Notification/Quote.vue
@@ -165,9 +165,10 @@ export default {
}
},
computed: {
- ...mapState({
- timeFormat: state => state.App.timeFormat,
- language: state => state.App.language
+ ...mapState('App', {
+ timeFormat: state => state.timeFormat,
+ language: state => state.language,
+ hideAllAttachments: state => state.hideAllAttachments
}),
shortcutEnabled: function () {
return this.focused && !this.overlaid
@@ -261,7 +262,7 @@ export default {
return !this.spoilered(message) || this.showContent
},
sensitive(message) {
- return message.sensitive && this.mediaAttachments(message).length > 0
+ return (this.hideAllAttachments || message.sensitive) && this.mediaAttachments(message).length > 0
},
isShowAttachments(message) {
return !this.sensitive(message) || this.showAttachments
diff --git a/src/renderer/components/organisms/Notification/Reaction.vue b/src/renderer/components/organisms/Notification/Reaction.vue
index 900abb8f..696a9585 100644
--- a/src/renderer/components/organisms/Notification/Reaction.vue
+++ b/src/renderer/components/organisms/Notification/Reaction.vue
@@ -153,10 +153,11 @@ export default {
}
},
computed: {
- ...mapState({
- displayNameStyle: state => state.App.displayNameStyle,
- timeFormat: state => state.App.timeFormat,
- language: state => state.App.language
+ ...mapState('App', {
+ displayNameStyle: state => state.displayNameStyle,
+ timeFormat: state => state.timeFormat,
+ language: state => state.language,
+ hideAllAttachments: state => state.hideAllAttachments
}),
shortcutEnabled: function () {
return this.focused && !this.overlaid
@@ -251,7 +252,7 @@ export default {
return !this.spoilered(message) || this.showContent
},
sensitive(message) {
- return message.sensitive && this.mediaAttachments(message).length > 0
+ return (this.hideAllAttachments || message.sensitive) && this.mediaAttachments(message).length > 0
},
isShowAttachments(message) {
return !this.sensitive(message) || this.showAttachments
diff --git a/src/renderer/components/organisms/Notification/Reblog.vue b/src/renderer/components/organisms/Notification/Reblog.vue
index f3655932..f123c8fe 100644
--- a/src/renderer/components/organisms/Notification/Reblog.vue
+++ b/src/renderer/components/organisms/Notification/Reblog.vue
@@ -155,9 +155,10 @@ export default {
}
},
computed: {
- ...mapState({
- timeFormat: state => state.App.timeFormat,
- language: state => state.App.language
+ ...mapState('App', {
+ timeFormat: state => state.timeFormat,
+ language: state => state.language,
+ hideAllAttachments: state => state.hideAllAttachments
}),
shortcutEnabled: function () {
return this.focused && !this.overlaid
@@ -251,7 +252,7 @@ export default {
return !this.spoilered(message) || this.showContent
},
sensitive(message) {
- return message.sensitive && this.mediaAttachments(message).length > 0
+ return (this.hideAllAttachments || message.sensitive) && this.mediaAttachments(message).length > 0
},
isShowAttachments(message) {
return !this.sensitive(message) || this.showAttachments