Load the cloud before any action

This commit is contained in:
Gregory Trolliet 2020-11-25 23:24:43 +01:00
parent 3ff96924fb
commit 76ab05c8c7
3 changed files with 22 additions and 33 deletions

View file

@ -4,14 +4,14 @@ include('templates/header.php');
if (isset($_GET['id'])) {
$id = $_GET['id'];
if (!$db->isCloud($id)) {
if (!$db->loadCloud($id)) {
echo '<p>' . L::cloud_noId . '</p>';
$id = null;
}
}
if (isset($id)) {
$nbWords = $db->countWords($id);
if ($db->isCloudSet()) {
$nbWords = $db->countWords();
if ($nbWords == 0) {
echo sprintf('<h2>%s</h2>', L::cloud_empty);
} else {