diff --git a/index.html b/index.html
index b6546e4..523ff29 100644
--- a/index.html
+++ b/index.html
@@ -286,10 +286,6 @@
Checking this box will sort the words in alphabetical order based on the Definition instead of the Word.
-
diff --git a/src/js/account/login.js b/src/js/account/login.js
index fc2887e..7c6fefd 100644
--- a/src/js/account/login.js
+++ b/src/js/account/login.js
@@ -2,7 +2,7 @@ import { request } from "./helpers";
import { saveToken } from "./utilities";
import { addMessage } from "../utilities";
import { setupLogoutButton } from "./setupListeners";
-import { renderAccountSettings, renderAccountActions } from "./render";
+import { renderAccountSettings, renderAccountActions, renderMakePublic } from "./render";
import { uploadWholeDictionary, syncDictionary } from "./sync";
import { setCookie } from "../StackOverflow/cookie";
@@ -143,6 +143,7 @@ export function triggerLoginChanges() {
loginButton.parentElement.removeChild(loginButton);
setupLogoutButton(logoutButton);
+ renderMakePublic();
renderAccountSettings();
renderAccountActions();
}
diff --git a/src/js/account/render.js b/src/js/account/render.js
index 6b5387f..c2b0730 100644
--- a/src/js/account/render.js
+++ b/src/js/account/render.js
@@ -53,6 +53,16 @@ export function renderLoginForm() {
setupLoginModal(loginModal);
}
+export function renderMakePublic() {
+ const editSettingsTab = document.getElementById('editSettingsTab');
+ const editSettingsTabHTML = `
+ `;
+ editSettingsTab.innerHTML += editSettingsTabHTML;
+}
+
export function renderAccountSettings() {
const accountSettingsColumn = document.getElementById('accountSettings');
const accountSettingsHTML = `Account Settings
diff --git a/src/js/dictionaryManagement.js b/src/js/dictionaryManagement.js
index 924677e..78d0338 100644
--- a/src/js/dictionaryManagement.js
+++ b/src/js/dictionaryManagement.js
@@ -35,7 +35,9 @@ export function openEditModal() {
document.getElementById('editCaseSensitive').checked = caseSensitive;
if (allowDuplicates) document.getElementById('editCaseSensitive').disabled = true;
document.getElementById('editSortByDefinition').checked = sortByDefinition;
- document.getElementById('editIsPublic').checked = isPublic;
+ if (hasToken()) {
+ document.getElementById('editIsPublic').checked = isPublic;
+ }
document.getElementById('editModal').style.display = '';
}
@@ -61,7 +63,11 @@ export function saveEditModal() {
window.currentDictionary.settings.caseSensitive = document.getElementById('editCaseSensitive').checked;
const needsReSort = window.currentDictionary.settings.sortByDefinition !== document.getElementById('editSortByDefinition').checked;
window.currentDictionary.settings.sortByDefinition = document.getElementById('editSortByDefinition').checked;
- window.currentDictionary.settings.isPublic = document.getElementById('editIsPublic').checked;
+ if (hasToken()) {
+ window.currentDictionary.settings.isPublic = document.getElementById('editIsPublic').checked;
+ } else {
+ window.currentDictionary.settings.isPublic = false;
+ }
addMessage('Saved ' + window.currentDictionary.specification + ' Successfully');
saveDictionary();