fix preview avatar issue

peertube
Namekuji 2023-01-24 01:03:15 -05:00
rodzic 693ea59845
commit 3d24066d2d
7 zmienionych plików z 9 dodań i 11 usunięć

Wyświetl plik

@ -29,7 +29,7 @@
{% end %}
</head>
<body>
<div id="app" data-version='0.2.0'></div>
<div id="app" data-version='0.2.1'></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

Wyświetl plik

@ -1,6 +1,6 @@
{
"name": "audon-fe",
"version": "0.2.0",
"version": "0.2.1",
"private": true,
"scripts": {
"dev": "cp -v index.dev.html index.html && vite",

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 45 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 19 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 24 KiB

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, true);
this.fetchMastoData(key, value);
}
}
} catch (error) {
@ -612,7 +612,7 @@ export default {
}
return metadata;
},
async fetchMastoData(identity, { remote_id, remote_url }, preview) {
async fetchMastoData(identity, { remote_id, remote_url }) {
if (this.cachedMastoData[identity] !== undefined) return;
try {
const url = new URL(remote_url);
@ -621,12 +621,8 @@ export default {
disableVersionCheck: true,
});
const info = await mastoClient.v1.accounts.fetch(remote_id);
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}`;
}
const resp = await axios.get(`/app/user/${identity}`);
info.avatar = `/storage/${resp.data.audon_id}/avatar/${resp.data.avatar}`;
this.cachedMastoData[identity] = info;
} catch (error) {
// FIXME: display error snackbar

Wyświetl plik

@ -53,3 +53,5 @@ services:
- db
- redis
- livekit
volumes:
- ./public/storage:/audon/public/storage

Wyświetl plik

@ -164,12 +164,12 @@ func main() {
e.GET("/app/verify", verifyHandler)
e.POST("/app/logout", logoutHandler)
e.GET("/app/preview/:id", previewRoomHandler)
e.GET("/app/user/:id", getUserHandler)
e.POST("/app/webhook", livekitWebhookHandler)
api := e.Group("/api", authMiddleware)
api.GET("/token", getOAuthTokenHandler)
api.GET("/user/:id", getUserHandler)
api.POST("/room", createRoomHandler)
api.DELETE("/room", leaveRoomHandler)
api.POST("/room/:id", joinRoomHandler)