瀏覽代碼

Merge branch 'v3.1.1'

Owen Diffey 3 年之前
父節點
當前提交
aba1ac5068

+ 1 - 1
backend/config/template.json

@@ -59,7 +59,7 @@
 		"secure": false,
 		"SIDname": "SID"
 	},
-	"blacklistedStationNames": ["musare"],
+	"blacklistedCommunityStationNames": ["musare"],
 	"skipConfigVersionCheck": false,
 	"skipDbDocumentsVersionCheck": false,
 	"debug": {

+ 1 - 1
backend/logic/actions/stations.js

@@ -2579,7 +2579,7 @@ export default {
 			"station"
 		];
 
-		if (data.type === "community" && config.get("blacklistedCommunityStationNames "))
+		if (data.type === "community" && config.has("blacklistedCommunityStationNames"))
 			blacklist = [...blacklist, ...config.get("blacklistedCommunityStationNames")];
 
 		async.waterfall(

+ 1 - 1
backend/package-lock.json

@@ -1,6 +1,6 @@
 {
   "name": "musare-backend",
-  "version": "3.1.0",
+  "version": "3.1.1",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {

+ 1 - 1
backend/package.json

@@ -1,7 +1,7 @@
 {
   "name": "musare-backend",
   "private": true,
-  "version": "3.1.0",
+  "version": "3.1.1",
   "type": "module",
   "description": "An open-source collaborative music listening and catalogue curation application. Currently supporting YouTube based content.",
   "main": "index.js",

+ 1 - 1
frontend/package-lock.json

@@ -1,6 +1,6 @@
 {
   "name": "musare-frontend",
-  "version": "3.1.0",
+  "version": "3.1.1",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {

+ 1 - 1
frontend/package.json

@@ -5,7 +5,7 @@
     "*.vue"
   ],
   "private": true,
-  "version": "3.1.0",
+  "version": "3.1.1",
   "description": "An open-source collaborative music listening and catalogue curation application. Currently supporting YouTube based content.",
   "main": "main.js",
   "author": "Musare Team",

+ 16 - 1
frontend/src/App.vue

@@ -47,7 +47,8 @@ export default {
 			socketConnected: true,
 			keyIsDown: false,
 			scrollPosition: { y: 0, x: 0 },
-			aModalIsOpen2: false
+			aModalIsOpen2: false,
+			broadcastChannel: null
 		};
 	},
 	computed: {
@@ -107,6 +108,20 @@ export default {
 				if (e.matches === !this.nightmode) this.toggleNightMode();
 			});
 
+		if (!this.loggedIn) {
+			lofig.get("cookie.SIDname").then(sid => {
+				this.broadcastChannel = new BroadcastChannel(
+					`${sid}.user_login`
+				);
+				this.broadcastChannel.onmessage = data => {
+					if (data) {
+						this.broadcastChannel.close();
+						window.location.reload();
+					}
+				};
+			});
+		}
+
 		document.onkeydown = ev => {
 			const event = ev || window.event;
 			const { keyCode } = event;

+ 10 - 3
frontend/src/store/modules/user.js

@@ -92,12 +92,19 @@ const modules = {
 			login: ({ commit }, user) =>
 				new Promise((resolve, reject) => {
 					auth.login(user)
-						.then(() =>
+						.then(() => {
+							lofig.get("cookie.SIDname").then(sid => {
+								const bc = new BroadcastChannel(
+									`${sid}.user_login`
+								);
+								bc.postMessage(true);
+								bc.close();
+							});
 							resolve({
 								status: "success",
 								message: "Logged in!"
-							})
-						)
+							});
+						})
 						.catch(err => reject(new Error(err.message)));
 				}),
 			logout: () =>