Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Commit

Permalink
Issue #18 - fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
swentel committed Apr 4, 2020
1 parent cdb18ec commit 019d1c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/indigenous.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ let snackbarElement;
let refreshChannels = false;
let currentChannel = 0;
let tokenInfoAdded = false;
let targetsAdded = false;
let anonymousMicrosubEndpoint = 'https://indigenous.realize.be/indieweb/microsub';
let defaultAuthor = '<div class="author-avatar"><img class="avatar" src="./images/avatar_small.png" width="80" height="80" /></div>';

Expand Down Expand Up @@ -73,6 +74,9 @@ function getMicropubConfig(reload, setSyndications) {
if (data) {
configSave('micropubConfig', data);
if (setSyndications) {
if (reload) {
targetsAdded = false;
}
addSyndicationTargetCheckboxes();
}
}
Expand All @@ -99,7 +103,8 @@ function getMicropubConfig(reload, setSyndications) {
*/
function addSyndicationTargetCheckboxes() {
let syndicationTargets = configGet('micropubConfig.syndicate-to');
if (undefined !== syndicationTargets && syndicationTargets.length > 0) {
if (!targetsAdded && undefined !== syndicationTargets && syndicationTargets.length > 0) {
targetsAdded = true;
let targets = $('.syndication-targets-wrapper .targets');
clearContainer('.syndication-target');
showContainer('.syndication-targets-wrapper');
Expand Down

0 comments on commit 019d1c0

Please sign in to comment.