Skip to content

Commit

Permalink
fix: miniapps loading fix (#1331)
Browse files Browse the repository at this point in the history
* v

* Update satolist.js

* v

* Update package.json
  • Loading branch information
maxgithubprofile authored Dec 15, 2024
1 parent eb351b8 commit 87b7301
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 34 deletions.
4 changes: 3 additions & 1 deletion components/application/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
left: 0.5em;
bottom: 5px;
}
#applicationfx .chat,
#applicationfx .chatDoubleRow {
padding-top: var(--app-margin-top);
}
#applicationfx .chat,
#applicationfx .chatDoubleRow {
height: calc(55px + var(--app-margin-top));
display: flex;
align-items: center;
Expand Down
5 changes: 4 additions & 1 deletion components/application/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@
}
}

.chat,
.chatDoubleRow{
padding-top: var(--app-margin-top);
}

.chat,
.chatDoubleRow{
height: calc(55px + var(--app-margin-top));
display: flex;
align-items: center;
Expand Down
16 changes: 6 additions & 10 deletions components/applicationmeta/templates/permissions.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<div class="subcaption">
<span><%-e('permissions')%></span>
</div>

<% if(permissions.length) {%>

<div class="subcaption">
<span><%-e('permissions')%></span>
</div>



<div class="list">
<% _.each(permissions, function(permission){

Expand Down Expand Up @@ -32,11 +34,5 @@

<% }) %>
</div>

<% } else { %>

<div class="empty">
empty
</div>

<% } %>
2 changes: 1 addition & 1 deletion components/home/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
margin-bottom: 0.5em;
}
#home .applicationsList .application .name {
max-width: 120px;
margin-bottom: 0.5em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
Expand Down
2 changes: 1 addition & 1 deletion components/home/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
}

.name {
max-width: 120px;
margin-bottom: 0.5em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
Expand Down
10 changes: 10 additions & 0 deletions config/Bastyon.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@
"includeinsearch" : true,
"includeminiapps" : true,
"store" : {"g" : true}
},{
"id" : "app.pocketnet.docs",
"version": "1.0.0",
"scope" : "docs.pocketnet.app",
"cantdelete" : true,
"develop" : true,
"install" : true,
"name" : "Bastyon documentation",
"grantedPermissions" : [],
"store" : {"g" : true, "i" : true}
}],
"protocol" : "bastyon",
"support" : "[email protected]",
Expand Down
3 changes: 2 additions & 1 deletion js/_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,8 @@ __map = {
anonimus : true,
renew : true,
reload : true,
viewchangereload : true
viewchangereload : true,
dontwait : true
},

bnavigation : {
Expand Down
44 changes: 30 additions & 14 deletions js/lib/apps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,9 @@ var BastyonApps = function (app) {
resolve()
}).catch(reject)
}
}).catch(e => {

return Promise.reject(e)
})

})))
Expand Down Expand Up @@ -1171,8 +1174,6 @@ var BastyonApps = function (app) {
result.installed = true
result.installing = false

console.log("INSTALL APPLICATION", application)

installed[application.id] = {
...application,
...result,
Expand Down Expand Up @@ -1783,8 +1784,6 @@ var BastyonApps = function (app) {
const localApps = loadAllAppsFromLocalhost() || [];
const allApps = [...developApps, ...localApps];

console.log('localApps', localApps, developApps)

if (allApps.length > 0) {

promises.push(Promise.all(_.map(allApps, (application) => {
Expand Down Expand Up @@ -1815,6 +1814,9 @@ var BastyonApps = function (app) {
...application,
develop: true,
version: numfromreleasestring(application?.version || '1.0.0')
}).catch(e => {

return Promise.resolve()
})
}

Expand All @@ -1827,9 +1829,6 @@ var BastyonApps = function (app) {

var installedLocal = getlocaldata()

console.log("INSTALLED LOCAL", installedLocal)


_.map(installedLocal, (info) => {
install(info.data, info.cached)
})
Expand All @@ -1842,7 +1841,7 @@ var BastyonApps = function (app) {

return install({
...application,
version: numfromreleasestring(application.version || '1.0.0')
//version: numfromreleasestring(application.version || '1.0.0')
}, info.cached)

}).then(() => {
Expand Down Expand Up @@ -2113,9 +2112,6 @@ var BastyonApps = function (app) {
};
const installedApps = this.installedAndInstalling();

console.log('instali', installed, installing)

console.log('installedApps', installedApps)

const filteredInstalledApps = filterApplications(transformedSearch, Object.values(installedApps), searchBy || 'name');

Expand All @@ -2126,11 +2122,9 @@ var BastyonApps = function (app) {
});
}

console.log('filteredInstalledApps', filteredInstalledApps, additionalApps)

const allApps = [...filteredInstalledApps, ...additionalApps]

const uniqueApps = Array.from(new Map(allApps.map(app => [app.id, app])).values());
const uniqueApps = Array.from(new Map(allApps.map(app => [app.id, app])).values());

return uniqueApps.map(adaptApplicationData);
},
Expand Down Expand Up @@ -2299,6 +2293,28 @@ var BastyonApps = function (app) {
})
}

self.openInWndById = function(id, clbk, path){

self.get.applicationall(id).then(({application}) => {
app.nav.api.load({
open: true,
href: 'application',
inWnd : true,
history : true,
eid: 'application_' + application.manifest.id,
clbk: clbk,

essenseData: {
application : application.manifest.id,
path : path

}
})
})


}

self.emit = emit

self.syncInstalledAppData = syncInstalledAppData
Expand Down
1 change: 1 addition & 0 deletions js/lib/apps/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ var BastyonSdk = function(){
}

document.documentElement.setAttribute('theme', theme.rootid);
document.documentElement.setAttribute('bastyon', 'bastyon');

document.documentElement.style.setProperty('--app-margin-top', `${margintop}`);

Expand Down
15 changes: 12 additions & 3 deletions js/navn.js
Original file line number Diff line number Diff line change
Expand Up @@ -900,24 +900,30 @@ Nav = function(app)
if(map.now === true) return true;
})


lazyEach({
array : map,
sync : false,
action : function(p){
var obj = p.item;

if(obj.dontwait){
if (p.success)
p.success();
}

core.load({
href : obj.href,
open : true,
clbk : function(error)
{

if(error)
{

}

if (p.success)
if (p.success && !obj.dontwait)
p.success();
}
})
Expand Down Expand Up @@ -1742,10 +1748,13 @@ Nav = function(app)
};
}


console.log("HERER1 !!!")

core.openInitialModules(function(){

console.log("HERE2 !!!")


p.open = true;
p.history = true;
p.loadDefault = true;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

"version": "0.9.105",

"versionsuffix": "1",
"versionsuffix": "2",
"cordovaversion": "1.8.105",
"cordovaversioncode": "1801051",
"cordovaversioncode": "1801052",

"description": "Bastyon desktop application",
"author": "Pocketnet Community <[email protected]>",
Expand Down

0 comments on commit 87b7301

Please sign in to comment.