update app count when a new app is created

This commit is contained in:
jelveh
2025-08-04 13:09:50 -07:00
parent 1d1b484bca
commit dc8b7ecb34
2 changed files with 7 additions and 1 deletions

View File

@@ -333,6 +333,7 @@
</div>
<script src="https://js.puter.com/v2/"></script>
<script src="http://puter.localhost:4100/sdk/puter.dev.js"></script>
<script src="./js/libs/jquery-3.6.0.min.js"></script>
<script src="./js/libs/jquery.dragster.js"></script>
<script src="./js/libs/slugify.js"></script>

View File

@@ -259,6 +259,11 @@ async function create_app(title, source_path = null, items = null) {
appUID: app.uid,
}
)
//----------------------------------------------------
// Increment app count
//----------------------------------------------------
$('.app-count').html(parseInt($('.app-count').html() ?? 0) + 1);
}).catch(async (err) => {
$('#create-app-error').show();
$('#create-app-error').html(err.message);
@@ -1308,7 +1313,7 @@ function count_apps() {
$('.app-card').each(function () {
count++;
})
$('.app-count').html(count);
$('.app-count').html(count ? count : '');
return count;
}