diff --git a/app/js/login/login.js b/app/js/login/login.js index dd6018f8..4b00856a 100644 --- a/app/js/login/login.js +++ b/app/js/login/login.js @@ -291,7 +291,12 @@ function refresh(target, loadskip) { localStorage.setItem("user-id_" + target, json["id"]); localStorage.setItem("prof_" + target, avatar); localStorage.setItem("follow_" + target, json["following_count"]); - console.log(obj) + if(json["source"]["sensitive"]){ + localStorage.setItem("nsfw_" + target, "true"); + }else{ + localStorage.removeItem("nsfw_" + target); + } + obj[target] = ref; var json = JSON.stringify(obj); localStorage.setItem("multi", json); if (!loadskip) { diff --git a/app/js/login/manager.js b/app/js/login/manager.js index 8596eb76..8e9a6c24 100644 --- a/app/js/login/manager.js +++ b/app/js/login/manager.js @@ -695,6 +695,11 @@ function refresh(target) { localStorage.setItem("user_" + target, json["acct"]); localStorage.setItem("user-id_" + target, json["id"]); localStorage.setItem("prof_" + target, avatar); + if(json["source"]["sensitive"]){ + localStorage.setItem("nsfw_" + target, "true"); + }else{ + localStorage.removeItem("nsfw_" + target); + } obj[target] = ref; var json = JSON.stringify(obj); localStorage.setItem("multi", json); diff --git a/app/js/post/img.js b/app/js/post/img.js index c89f8bbc..eb9b861d 100644 --- a/app/js/post/img.js +++ b/app/js/post/img.js @@ -151,6 +151,11 @@ function media(b64, type, no) { $("#textarea").val($("#textarea").val() + " " + json["text_url"]) } todc(); + if(localStorage.getItem("nsfw_" + acct_id)){ + $("#nsfw").addClass("yellow-text"); + $("#nsfw").html("visibility"); + $("#nsfw").addClass("nsfw-avail"); + } $(".toot-btn-group").prop("disabled", false); $('select').formSelect(); $("#mec").text(lang.lang_there); diff --git a/app/js/ui/post-box.js b/app/js/ui/post-box.js index 2c27ea73..41f686f5 100644 --- a/app/js/ui/post-box.js +++ b/app/js/ui/post-box.js @@ -55,6 +55,7 @@ function show() { } $('#post-box').fadeIn(); $('#textarea').characterCounter(); + mdCheck() } $(function () {