{ open_warned = !open_warned }}> +
+ {/if} {#if !post.warning || open_warned} {#if post.text} @@ -27,10 +27,18 @@ {/if}diff --git a/package.json b/package.json index 18c0ab0..28b14be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "spacesocial-client", - "version": "0.1.0", + "version": "0.1.1", "description": "social media for the galaxy-wide-web! 🌌", "type": "module", "scripts": { diff --git a/src/client/api.js b/src/client/api.js index 9dc440c..6528fd9 100644 --- a/src/client/api.js +++ b/src/client/api.js @@ -148,6 +148,7 @@ export async function parsePost(data, num_replies) { post.boost_count = data.reblogs_count; post.reply_count = data.replies_count; post.mentions = data.mentions; + if (data.media_attachments.length > 0) console.log(data.media_attachments); post.files = data.media_attachments; post.url = data.url; post.visibility = data.visibility; diff --git a/src/client/client.js b/src/client/client.js index 7480cb9..5a4988f 100644 --- a/src/client/client.js +++ b/src/client/client.js @@ -1,3 +1,4 @@ +import { version as APP_VERSION } from '../../package.json'; import { Instance, server_types } from './instance.js'; import * as api from './api.js'; @@ -118,6 +119,7 @@ export class Client { save() { localStorage.setItem(save_name, JSON.stringify({ + version: APP_VERSION, instance: { host: this.instance.host, version: this.instance.version, @@ -130,6 +132,11 @@ export class Client { let json = localStorage.getItem(save_name); if (!json) return false; let saved = JSON.parse(json); + if (!saved.version || saved.version !== APP_VERSION) { + localStorage.setItem(save_name + '-backup', json); + localStorage.removeItem(save_name); + return false; + } this.instance = new Instance(saved.instance.host, saved.instance.version); this.app = saved.app; return true; diff --git a/src/post/Body.svelte b/src/post/Body.svelte index cd726b7..14b9ddc 100644 --- a/src/post/Body.svelte +++ b/src/post/Body.svelte @@ -8,7 +8,7 @@
{ open_warned = !open_warned }}> +
+ {/if} {#if !post.warning || open_warned} {#if post.text} @@ -27,10 +27,18 @@ {/if}