From cb0ff28b61a4c7270c4aa3f85b7cff00685ae30d Mon Sep 17 00:00:00 2001 From: booploops <49113086+booploops@users.noreply.github.com> Date: Sat, 4 Dec 2021 11:51:31 -0800 Subject: [PATCH] change to username display --- resources/cider-ui-tests/index.html | 9 ++++++++- resources/cider-ui-tests/index.js | 9 ++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/resources/cider-ui-tests/index.html b/resources/cider-ui-tests/index.html index ab076190..b807d82b 100644 --- a/resources/cider-ui-tests/index.html +++ b/resources/cider-ui-tests/index.html @@ -151,7 +151,14 @@
- + diff --git a/resources/cider-ui-tests/index.js b/resources/cider-ui-tests/index.js index 0566456c..66331b19 100644 --- a/resources/cider-ui-tests/index.js +++ b/resources/cider-ui-tests/index.js @@ -119,19 +119,22 @@ const app = new Vue({ details: {} }, chrome: { - artworkReady: false + artworkReady: false, + userinfo: { + + } }, page: "browse" }, methods: { - init() { + async init() { let self = this this.mk = MusicKit.getInstance() this.mk.authorize() this.$forceUpdate() // Set profile name - this.mk.api.personalSocialProfile().then(function(result) {document.getElementById("userName").innerHTML = result.attributes.name}); + this.chrome.userinfo = await this.mkapi("personalSocialProfile", false, "") this.mk.addEventListener(MusicKit.Events.playbackTimeDidChange, (a) => { self.playerLCD.playbackDuration = (self.mk.currentPlaybackTime)