1
0
Эх сурвалжийг харах

Merge branch 'polishing' into owen

Owen Diffey 3 жил өмнө
parent
commit
bf00cc0a0a

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

@@ -1304,7 +1304,7 @@ export default {
 								.then(socket => {
 									if (socket && socket.session && socket.session.userId) {
 										if (!users.includes(socket.session.userId)) users.push(socket.session.userId);
-									} else users.push(socketId);
+									}
 									return next();
 								})
 								.catch(next);

+ 2 - 0
backend/logic/actions/users.js

@@ -254,6 +254,8 @@ export default {
 								stationModel.deleteOne({ _id: station._id }, err => {
 									if (err) return callback(err);
 
+									CacheModule.runJob("HDEL", { table: "stations", key: station._id });
+
 									// if applicable, delete the corresponding playlist for the station
 									if (station.playlist)
 										return PlaylistsModule.runJob("DELETE_PLAYLIST", {

+ 11 - 3
frontend/src/components/modals/ManageStation/index.vue

@@ -474,6 +474,17 @@ export default {
 							},
 							{ modal: "manageStation" }
 						);
+
+						this.socket.on(
+							"event:station.deleted",
+							() => {
+								new Toast(
+									`The station you were editing was deleted.`
+								);
+								this.closeModal("manageStation");
+							},
+							{ modal: "manageStation" }
+						);
 					} else {
 						new Toast(`Station with that ID not found`);
 						this.closeModal("manageStation");
@@ -493,9 +504,6 @@ export default {
 		removeStation() {
 			this.socket.dispatch("stations.remove", this.station._id, res => {
 				new Toast(res.message);
-				if (res.status === "success") {
-					this.closeModal("manageStation");
-				}
 			});
 		},
 		resumeStation() {

+ 4 - 8
frontend/src/components/modals/RemoveAccount.vue

@@ -54,11 +54,7 @@
 				</p>
 
 				<p class="content-box-optional-helper">
-					<router-link
-						id="forgot-password"
-						href="#"
-						to="/reset_password"
-					>
+					<router-link id="forgot-password" to="/reset_password">
 						Forgot password?
 					</router-link>
 				</p>
@@ -94,12 +90,12 @@
 							</a>
 						</div>
 						<p class="control">
-							<a
+							<button
 								class="button is-info"
-								href="#"
 								@click="confirmPasswordMatch()"
-								>Check</a
 							>
+								Check
+							</button>
 						</p>
 					</div>
 				</div>

+ 1 - 4
frontend/src/main.js

@@ -126,10 +126,7 @@ const router = createRouter({
 		},
 		{
 			path: "/reset_password",
-			component: () => import("@/pages/ResetPassword.vue"),
-			meta: {
-				guestsOnly: true
-			}
+			component: () => import("@/pages/ResetPassword.vue")
 		},
 		{
 			path: "/set_password",

+ 1 - 1
frontend/src/pages/Station/index.vue

@@ -1090,7 +1090,7 @@ export default {
 		});
 
 		this.socket.on("event:station.deleted", () => {
-			window.location.href = "/";
+			window.location.href = "/?msg=The station you were in was deleted.";
 			return true;
 		});