mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Add notifications, notification on subscribe/unsubscribe in channels and subscriptions pages
This commit is contained in:
parent
a1dbd4d4fa
commit
90916e70b2
7 changed files with 38 additions and 0 deletions
|
@ -12,6 +12,7 @@
|
||||||
"@fortawesome/free-brands-svg-icons": "^5.15.4",
|
"@fortawesome/free-brands-svg-icons": "^5.15.4",
|
||||||
"@fortawesome/free-solid-svg-icons": "^5.15.4",
|
"@fortawesome/free-solid-svg-icons": "^5.15.4",
|
||||||
"@fortawesome/vue-fontawesome": "^3.0.0-4",
|
"@fortawesome/vue-fontawesome": "^3.0.0-4",
|
||||||
|
"@kyvg/vue3-notification": "^2.3.4",
|
||||||
"core-js": "3.18.2",
|
"core-js": "3.18.2",
|
||||||
"css-loader": "^6.4.0",
|
"css-loader": "^6.4.0",
|
||||||
"dompurify": "^2.3.3",
|
"dompurify": "^2.3.3",
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
|
<notifications />
|
||||||
<div class="uk-flex">
|
<div class="uk-flex">
|
||||||
<Menu style="flexShrink: 0" />
|
<Menu style="flexShrink: 0" />
|
||||||
<main
|
<main
|
||||||
|
|
|
@ -120,6 +120,18 @@ export default {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.subscribed = !this.subscribed;
|
this.subscribed = !this.subscribed;
|
||||||
|
|
||||||
|
var notifText;
|
||||||
|
if (this.subscribed) {
|
||||||
|
notifText = this.$t("notifications.notif_subscribe");
|
||||||
|
} else {
|
||||||
|
notifText = this.$t("notifications.notif_unsubscribe");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$notify({
|
||||||
|
text: notifText,
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -141,6 +141,18 @@ export default {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
subscription.subscribed = !subscription.subscribed;
|
subscription.subscribed = !subscription.subscribed;
|
||||||
|
|
||||||
|
var notifText;
|
||||||
|
if (this.subscribed) {
|
||||||
|
notifText = this.$t("notifications.notif_subscribe");
|
||||||
|
} else {
|
||||||
|
notifText = this.$t("notifications.notif_unsubscribe");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$notify({
|
||||||
|
text: notifText,
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
},
|
},
|
||||||
exportHandler() {
|
exportHandler() {
|
||||||
const subscriptions = [];
|
const subscriptions = [];
|
||||||
|
|
|
@ -73,6 +73,10 @@
|
||||||
"no_subscriptions_in_subscriptions_2": "to see your subscriptions here.",
|
"no_subscriptions_in_subscriptions_2": "to see your subscriptions here.",
|
||||||
"no_subscriptions_in_subscriptions_title": "No subscriptions yet"
|
"no_subscriptions_in_subscriptions_title": "No subscriptions yet"
|
||||||
},
|
},
|
||||||
|
"notifications": {
|
||||||
|
"notif_subscribe": "Successfully subscribed!",
|
||||||
|
"notif_unsubscribe": "Successfully unsubscribed!"
|
||||||
|
},
|
||||||
"comment": {
|
"comment": {
|
||||||
"pinned_by": "Pinned by"
|
"pinned_by": "Pinned by"
|
||||||
},
|
},
|
||||||
|
|
|
@ -59,6 +59,8 @@ const timeAgo = new TimeAgo("en-US");
|
||||||
|
|
||||||
import("./registerServiceWorker");
|
import("./registerServiceWorker");
|
||||||
|
|
||||||
|
import Notifications from "@kyvg/vue3-notification";
|
||||||
|
|
||||||
const mixin = {
|
const mixin = {
|
||||||
methods: {
|
methods: {
|
||||||
timeFormat: function(duration) {
|
timeFormat: function(duration) {
|
||||||
|
@ -259,6 +261,7 @@ window.i18n = i18n;
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
app.use(i18n);
|
app.use(i18n);
|
||||||
app.use(router);
|
app.use(router);
|
||||||
|
app.use(Notifications);
|
||||||
app.mixin(mixin);
|
app.mixin(mixin);
|
||||||
app.component("FontAwesomeIcon", FontAwesomeIcon);
|
app.component("FontAwesomeIcon", FontAwesomeIcon);
|
||||||
app.mount("#app");
|
app.mount("#app");
|
||||||
|
|
|
@ -1067,6 +1067,11 @@
|
||||||
"@intlify/runtime" "9.1.9"
|
"@intlify/runtime" "9.1.9"
|
||||||
"@intlify/shared" "9.1.9"
|
"@intlify/shared" "9.1.9"
|
||||||
|
|
||||||
|
"@kyvg/vue3-notification@^2.3.4":
|
||||||
|
version "2.3.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/@kyvg/vue3-notification/-/vue3-notification-2.3.4.tgz#7503647ae1d26a7c58bbf5182b505ca345c0882a"
|
||||||
|
integrity sha512-20Km1L75gncIZCjosT1OKbJl9HhNiOd7LRXqVIqlehHHem9NgBjQhDFz6XGo1RcF0MyA4/BC7kV7tcq/PMT+tA==
|
||||||
|
|
||||||
"@mrmlnc/readdir-enhanced@^2.2.1":
|
"@mrmlnc/readdir-enhanced@^2.2.1":
|
||||||
version "2.2.1"
|
version "2.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde"
|
resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue