浏览代码

Update Profile component, rewrite local profile urls

Daniel Supernault 4 月之前
父节点
当前提交
dfbccaa195
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      resources/assets/components/Profile.vue

+ 7 - 0
resources/assets/components/Profile.vue

@@ -131,6 +131,9 @@
                     // this.fetchPosts();
                     // this.isLoaded = true;
                     this.fetchRelationship();
+                    if(this.cachedProfile && this.cachedProfile.local) {
+                        window.history.pushState({}, '', `/${this.cachedProfile.acct}`);
+                    }
                 } else {
                     this.curUser = window._sharedData.user;
                     this.fetchProfile();
@@ -164,6 +167,10 @@
                         this.owner = false;
                         this.fetchRelationship();
                     }
+
+                    if(res.data && res.data.local) {
+                        window.history.pushState({}, '', `/${res.data.acct}`);
+                    }
                 })
                 .catch(err => {
                     this.$router.push('/i/web/404');