pad.html: UI telling the user that a contribution is required before importing

This commit is an integration to 24ee37a38f.
This commit is contained in:
John McLear 2020-04-14 11:00:47 +00:00 committed by muxator
parent c6cb253f76
commit 208c7a849c
7 changed files with 43 additions and 3 deletions

View file

@ -939,6 +939,16 @@ async function handleClientReady(client, message)
});
}));
let thisUserHasEditedThisPad = false;
if (historicalAuthorData[statusObject.authorID]) {
/*
* This flag is set to true when a user contributes to a specific pad for
* the first time. It is used for deciding if importing to that pad is
* allowed or not.
*/
thisUserHasEditedThisPad = true;
}
// glue the clientVars together, send them and tell the other clients that a new one is there
// Check that the client is still here. It might have disconnected between callbacks.
@ -1118,7 +1128,8 @@ async function handleClientReady(client, message)
"scrollWhenCaretIsInTheLastLineOfViewport": settings.scrollWhenFocusLineIsOutOfViewport.scrollWhenCaretIsInTheLastLineOfViewport,
"percentageToScrollWhenUserPressesArrowUp": settings.scrollWhenFocusLineIsOutOfViewport.percentageToScrollWhenUserPressesArrowUp,
},
"initialChangesets": [] // FIXME: REMOVE THIS SHIT
"initialChangesets": [], // FIXME: REMOVE THIS SHIT
"thisUserHasEditedThisPad": thisUserHasEditedThisPad,
}
// Add a username to the clientVars if one avaiable