mirror of
https://github.com/HeyPuter/puter.git
synced 2026-01-05 12:40:26 -06:00
update app count when a new app is created
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user