fix preview mode

peertube
Namekuji 2023-01-23 11:13:50 -05:00
rodzic 29dc87b382
commit 693ea59845
4 zmienionych plików z 13 dodań i 11 usunięć

Wyświetl plik

@ -21,8 +21,6 @@ RUN apt-get update && \
apt-get -y --no-install-recommends install libmagick++-dev libwebp-dev && \
go build -v -o audon-bin .
RUN
FROM ubuntu:jammy
WORKDIR /audon
@ -35,7 +33,7 @@ COPY public /audon/public
RUN echo "Etc/UTC" > /etc/localtime && \
apt-get update && apt-get upgrade -y && \
apt-get -y --no-install-recommends install \
imagemagick libwebp \
imagemagick webp \
tini \
tzdata \
ca-certificates

Wyświetl plik

@ -1,12 +1,12 @@
{
"name": "audon-fe",
"version": "0.1.2",
"version": "0.2.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "audon-fe",
"version": "0.1.2",
"version": "0.2.0",
"dependencies": {
"@intlify/unplugin-vue-i18n": "^0.8.1",
"@picmo/popup-picker": "^5.7.2",

Wyświetl plik

@ -60,7 +60,7 @@ export const useMastodonStore = defineStore("mastodon", {
avatar: new File([avatarBlob], token.data.audon.avatar),
});
}
}, 2 * 1000);
}, 1500);
sessionStorage.setItem("avatar_timeout", t.toString());
},
},

Wyświetl plik

@ -172,7 +172,7 @@ export default {
this.mutedSpeakerIDs = new Set(Object.keys(this.participants));
for (const [key, value] of Object.entries(this.participants)) {
if (value !== null) {
this.fetchMastoData(key, value);
this.fetchMastoData(key, value, true);
}
}
} catch (error) {
@ -486,7 +486,7 @@ export default {
onResize() {
const mainArea = document.getElementById("mainArea");
const height = mainArea.clientHeight;
this.mainHeight = height > 700 ? 700 : window.innerHeight - 110;
this.mainHeight = height > 720 ? 700 : window.innerHeight - 120;
},
isHost(identity) {
return identity === this.roomInfo.host?.audon_id;
@ -612,7 +612,7 @@ export default {
}
return metadata;
},
async fetchMastoData(identity, { remote_id, remote_url }) {
async fetchMastoData(identity, { remote_id, remote_url }, preview) {
if (this.cachedMastoData[identity] !== undefined) return;
try {
const url = new URL(remote_url);
@ -621,8 +621,12 @@ export default {
disableVersionCheck: true,
});
const info = await mastoClient.v1.accounts.fetch(remote_id);
const resp = await axios.get(`/api/user/${identity}`);
info.avatar = `/storage/${resp.data.audon_id}/avatar/${resp.data.avatar}`;
if (preview) {
info.avatar = `/storage/${this.participants[identity].audon_id}/avatar/${this.participants[identity].avatar}`;
} else {
const resp = await axios.get(`/api/user/${identity}`);
info.avatar = `/storage/${resp.data.audon_id}/avatar/${resp.data.avatar}`;
}
this.cachedMastoData[identity] = info;
} catch (error) {
// FIXME: display error snackbar