In demo mode, don't bother trying to create feeds, folders.

This commit is contained in:
voussoir 2022-03-30 20:24:29 -07:00
parent 2e2d85ff26
commit 8b79773c5b
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -443,6 +443,8 @@ body
</body> </body>
<script type="text/javascript"> <script type="text/javascript">
DEMO_MODE = {{'true' if site.demo_mode else 'false'}};
AUTOMATIC_RELOAD_FEEDS_INTERVAL = 5 * 60 * 1000; AUTOMATIC_RELOAD_FEEDS_INTERVAL = 5 * 60 * 1000;
const newsreader = document.getElementById("newsreader"); const newsreader = document.getElementById("newsreader");
@ -507,6 +509,11 @@ function add_feed_submit(event)
const settings_url = `/feed/${feed_id}/settings`; const settings_url = `/feed/${feed_id}/settings`;
window.location.href = settings_url; window.location.href = settings_url;
} }
if (DEMO_MODE)
{
contextmenus.hide_open_menus();
return spinners.BAIL;
}
const rss_url = document.getElementById("add_feed_url_input").value.trim(); const rss_url = document.getElementById("add_feed_url_input").value.trim();
if (! rss_url) if (! rss_url)
{ {
@ -542,6 +549,11 @@ function add_folder_submit(event)
input.value = ""; input.value = "";
} }
} }
if (DEMO_MODE)
{
contextmenus.hide_open_menus();
return spinners.BAIL;
}
const button = event.target; const button = event.target;
const rss_url = ""; const rss_url = "";
const input = document.getElementById("add_folder_title_input"); const input = document.getElementById("add_folder_title_input");