Просмотр исходного кода

fix(Settings): github/password unlinking refreshes without reload of page

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 4 лет назад
Родитель
Сommit
0e46a0ebf8

+ 5 - 3
frontend/src/pages/Settings/index.vue

@@ -119,12 +119,14 @@ export default {
 					})
 				);
 
-				this.socket.on("event:user.unlinkGithub", () =>
+				this.socket.on("event:user.unlinkGithub", () => {
 					this.updateOriginalUser({
 						property: "github",
 						value: false
-					})
-				);
+					});
+
+					console.log("unlink");
+				});
 			});
 		}
 	},

+ 3 - 3
frontend/src/pages/Settings/tabs/Security.vue

@@ -76,7 +76,7 @@
 				Link your Musare account with GitHub.
 			</p>
 
-			<hr style="margin: 30px 0" />
+			<hr class="section-horizontal-rule" />
 
 			<a
 				class="button is-github"
@@ -87,10 +87,10 @@
 				</div>
 				&nbsp; Link GitHub to account
 			</a>
-
-			<br /><br />
 		</div>
 
+		<div v-if="!isGithubLinked"><br /><br /></div>
+
 		<div v-if="isPasswordLinked && isGithubLinked">
 			<h4 class="section-title">Remove login methods</h4>
 			<p class="section-description">

+ 2 - 2
frontend/src/store/modules/settings.js

@@ -6,8 +6,8 @@ const state = {
 };
 
 const getters = {
-	isGithubLinked: state => state.modifiedUser.github,
-	isPasswordLinked: state => state.modifiedUser.password
+	isGithubLinked: state => state.originalUser.github,
+	isPasswordLinked: state => state.originalUser.password
 };
 
 const actions = {