Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Cesium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
Cesium-grp
Cesium
Commits
a2cf3226
Commit
a2cf3226
authored
6 months ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
enh(migration): Improve deep link and web/desktop cases
parent
57b17d75
Branches
feat/force-migration-check
No related tags found
1 merge request
!669
feat(migration): Implement forced update on v2s migration
Pipeline
#38442
skipped
Stage: alt_build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
www/js/services/migration-services.js
+44
-12
44 additions, 12 deletions
www/js/services/migration-services.js
with
44 additions
and
12 deletions
www/js/services/migration-services.js
+
44
−
12
View file @
a2cf3226
...
...
@@ -8,17 +8,12 @@ angular.module('cesium.services')
// Check migration state
function
checkMigrationState
()
{
// Skip migration check if not on mobile platform
if
(
!
ionic
.
Platform
.
isAndroid
()
&&
!
ionic
.
Platform
.
isIOS
())
{
return
Promise
.
resolve
();
}
const
primaryUrl
=
'
https://v2s-migration-state.axiom-team.fr
'
;
const
backupUrl
=
'
https://v2s-migration-state.duniter.org
'
;
// First attempt
return
$http
.
get
(
primaryUrl
,
{
timeout
:
2
000
timeout
:
3
000
})
.
then
(
function
(
response
)
{
if
(
response
.
data
&&
response
.
data
.
migration
===
true
)
{
...
...
@@ -28,7 +23,7 @@ angular.module('cesium.services')
.
catch
(
function
()
{
// If first route fails, try backup route
return
$http
.
get
(
backupUrl
,
{
timeout
:
3
000
timeout
:
5
000
})
.
then
(
function
(
response
)
{
if
(
response
.
data
&&
response
.
data
.
migration
===
true
)
{
...
...
@@ -57,15 +52,52 @@ angular.module('cesium.services')
text
:
'
<b>
'
+
$translate
.
instant
(
'
MIGRATION.UPDATE_ACTION
'
)
+
'
</b>
'
,
type
:
'
button-positive button-large
'
,
onTap
:
function
(
e
)
{
e
.
preventDefault
();
var
storeUrl
=
ionic
.
Platform
.
isAndroid
()
?
'
https://play.google.com/store/apps/details?id=fr.duniter.cesium
'
:
'
https://apps.apple.com/us/app/cesium-%C4%9F1/id1471028018
'
;
$window
.
open
(
storeUrl
,
'
_system
'
);
e
.
preventDefault
();
// Do not close popup on tap
openStore
();
}
}]
});
}
function
getStoreUrls
()
{
if
(
ionic
.
Platform
.
isAndroid
())
{
return
{
storeUrl
:
'
market://details?id=fr.duniter.cesium
'
,
fallbackUrl
:
'
https://play.google.com/store/apps/details?id=fr.duniter.cesium
'
};
}
if
(
ionic
.
Platform
.
isIOS
())
{
return
{
storeUrl
:
'
itms-apps://itunes.apple.com/app/id1471028018
'
,
fallbackUrl
:
'
https://apps.apple.com/us/app/cesium-%C4%9F1/id1471028018
'
};
}
return
{
storeUrl
:
'
https://cesium.app
'
,
fallbackUrl
:
'
https://cesium.app
'
};
}
function
openStore
()
{
const
urls
=
getStoreUrls
();
try
{
// Try to open with InAppBrowser first for better integration
if
(
window
.
cordova
&&
window
.
cordova
.
InAppBrowser
)
{
cordova
.
InAppBrowser
.
open
(
urls
.
storeUrl
,
'
_system
'
);
}
else
{
// Fallback to direct window.open for web browsers
$window
.
open
(
urls
.
storeUrl
,
'
_system
'
);
}
}
catch
(
e
)
{
// If deep link fails, fallback to direct URL
console
.
error
(
'
Error opening store:
'
,
e
);
if
(
window
.
cordova
&&
window
.
cordova
.
InAppBrowser
)
{
cordova
.
InAppBrowser
.
open
(
urls
.
fallbackUrl
,
'
_system
'
);
}
else
{
$window
.
open
(
urls
.
fallbackUrl
,
'
_system
'
);
}
}
}
return
service
;
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment