From 2909a350404d4e4ae5ce8ca44c20dc3f149551c7 Mon Sep 17 00:00:00 2001
From: CatAClock <CatAClock@proton.me>
Date: Fri, 30 May 2025 18:26:24 -0700
Subject: [PATCH] bug fixes

---
 JS/BlueskyAPI.js | 2 +-
 JS/post.js       | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/JS/BlueskyAPI.js b/JS/BlueskyAPI.js
index 30d383d..6487c31 100644
--- a/JS/BlueskyAPI.js
+++ b/JS/BlueskyAPI.js
@@ -155,7 +155,7 @@ export async function CreatePost(DID, Text, ContentWarning = undefined, Tags = [
 		let matches = body.message.match(/(\d+)/);
 		Record.text = Text.slice(0, matches[0] - 1);
 		body = await CreateRecord(DID, "app.bsky.feed.post", Record, undefined);
-		if (ReplyID != undefined && RootID != undefined) {
+		if (ReplyID == undefined && RootID == undefined) {
 			await CreatePost(DID, Text.slice(matches[0] - 1, Text.length), ContentWarning, Tags, body, body);
 		} else {
 			await CreatePost(DID, Text.slice(matches[0] - 1, Text.length), ContentWarning, Tags, body, RootID);
diff --git a/JS/post.js b/JS/post.js
index c470b00..20e9921 100644
--- a/JS/post.js
+++ b/JS/post.js
@@ -34,13 +34,16 @@ async function Post() {
 	if (localStorage.getItem(Variables.MastodonAccessToken) != null) {
 		let TempVisible;
 		// Adding tags
-		let TempText = Text + "<br/><br/>";
+		let TempText = Text;
 		let Tags = TagsInputArea.value.split(";");
+		if (Tags.length > 1) {
+			TempText += "<br/><br/>";
+		}
 		for (let i of Tags) {
 			while (i[0] == " ") {
 				i = i.substring(1, i.length);
 			}
-			if (i[0] != "#") {
+			if (i[0] != "#" && i.length != 0) {
 				i = "#" + i;
 			}
 			TempText += i + " ";
@@ -87,7 +90,7 @@ async function Post() {
 			while (i[0] == " ") {
 				i = i.substring(1, i.length);
 			}
-			if (i[0] != "#") {
+			if (i[0] != "#" && i.length != 0) {
 				i = "#" + i;
 			}
 			TagsTemp.push(i);