From c81dfdf5c9956d0e066bd15cc37ffdac4fbdc88a Mon Sep 17 00:00:00 2001 From: Inex Code Date: Thu, 5 May 2022 19:44:43 +0000 Subject: [PATCH] fix --- bin/server.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/server.dart b/bin/server.dart index c9e82df..165164e 100644 --- a/bin/server.dart +++ b/bin/server.dart @@ -47,7 +47,7 @@ Future _importPosts(fileUri) async { } // Read posts.json and add posts to it - final postsJson = json.decode(await File('posts.json').readAsString()) as List; + final postsJson = json.decode(await File('posts.json').readAsString()); postsJson.addAll(posts); // Write posts.json @@ -71,7 +71,7 @@ Future _postRandomPost() async { return; } - final postsJson = json.decode(await File('posts.json').readAsString()) as List; + final postsJson = json.decode(await File('posts.json').readAsString()); if (postsJson.isEmpty) { return; @@ -93,7 +93,7 @@ void main(List args) async { } // Import posts from files - await _importPosts('/posts.txt'); + await _importPosts('/data/posts.txt'); // Post a random post await _postRandomPost();