Skip to content

Commit

Permalink
fix profile save button not working sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Oct 9, 2024
1 parent 45da676 commit 15ae928
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pages/profile/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,11 @@ export default {
this.localUser.media.splice(index, 1);
},
validForm(scope, boolResult, sentence) {
if (scope.startsWith("username:") || scope.startsWith("uuid")) {
if (scope.startsWith("username:") || scope.startsWith("uuid:")) {
// socials are validated separately since there's multiple of them
this.validationObject[scope] = boolResult;
this.$set(this.validationObject, scope, boolResult);
}
if (boolResult) return true;
return sentence.toString();
},
Expand Down Expand Up @@ -320,10 +321,10 @@ export default {
canSubmit() {
// media handled separately since there's multiple
if (
!(this.localUser.media || []).every((m) => {
if (!this.validURL(m.link)) return false;
if (!this.mediaTypes.includes(m.type)) return false;
return true;
(this.localUser.media || []).some((m) => {
if (!this.validURL(m.link)) return true;
if (!this.mediaTypes.includes(m.type)) return true;
return false;
})
)
return false;
Expand Down

0 comments on commit 15ae928

Please sign in to comment.