Comments (3)
Hi @ziomek64,
thanks for informing me about the issue. Where exactly do you call SimpleToolkit.SimpleShell.SimpleShell.Current.GoToAsync($"//main");
? Does the app crash even if this call is commented out?
from simpletoolkit.
It happens in OnAppearing for my login page. The app doesn't crash when its commented or with normal shell
protected override async void OnAppearing()
{
var token = Preferences.Get("token", "default_value");
bool validation = true;
try
{
validation = false;
if (token != "default_value")
{
IJsonSerializer serializer = new JsonNetSerializer();
var provider = new UtcDateTimeProvider();
IJwtValidator validator = new JwtValidator(serializer, provider);
IBase64UrlEncoder urlEncoder = new JwtBase64UrlEncoder();
IJwtAlgorithm algorithm = new HMACSHA256Algorithm(); // symmetric
IJwtDecoder decoder = new JwtDecoder(serializer, validator, urlEncoder, algorithm);
//TODO decoding z login taska i sprawdzanie expiry w ten sposob
//var json = decoder.Decode(token);
validation = true;
}
}
catch (TokenExpiredException)
{
Preferences.Set("token", "default_value");
}
catch (SignatureVerificationException)
{
Preferences.Set("token", "default_value");
}
catch (InvalidTokenPartsException)
{
Preferences.Set("token", "default_value");
}
catch (HttpRequestException httpRequestException)
{
Debug.WriteLine(httpRequestException.Message);
MainThread.BeginInvokeOnMainThread(() =>
{
var toast = Toast.Make("No internet.", duration, fontSize);
toast.Show(cancellationTokenSource.Token);
});
}
catch (Exception e)
{
Debug.WriteLine(e);
if (e.Message.Contains("Unable to resolve host"))
{
MainThread.BeginInvokeOnMainThread(() =>
{
//DependencyService.Get<Toast>().Show("Unexpected error happened");
var toast = Toast.Make("No internet.", duration, fontSize);
toast.Show(cancellationTokenSource.Token);
});
}
else
{
MainThread.BeginInvokeOnMainThread(() =>
{
//DependencyService.Get<Toast>().Show("Unexpected error happened");
var toast = Toast.Make("Unexpected error happened.", duration, fontSize);
toast.Show(cancellationTokenSource.Token);
});
}
}
finally
{
if (validation)
{
await SimpleToolkit.SimpleShell.SimpleShell.Current.GoToAsync($"//main");
}
}
}
Should simple shell be installed in platform specific projects too or not?
from simpletoolkit.
Hi @ziomek64,
I have finally tried to take a look at this issue. However, I probably will not be able to fix it because of the way how creating a handler for a ShellItem
works.
A workaround to this issue is to delay the navigation using Task.Delay()
a bit:
await Task.Delay(100);
await Shell.Current.GoToAsync($"//main");
The delay is needed only on the first navigation to the initial page. On subsequent navigations to that page and on other pages it should not be needed.
And by the way, I currently do not plan to continue developing the SimpleToolkit.SimpleShell.Controls package, so I do not recommend using that.
from simpletoolkit.
Related Issues (15)
- DisplayContentBehindBars HOT 3
- Swipe to go back gesture not working in iOS HOT 4
- Shell search handler ? HOT 1
- No way i can logout and login using your Shell Navigation. HOT 1
- Converting from SimpleShell to Shell? HOT 1
- Combine flyout and bottom bar HOT 1
- SearchHandler
- How to navigate from tap gesture? HOT 3
- ButtonContent does not display icon HOT 1
- [UPDATE] .net 8 support HOT 5
- Can not use Simple Shell "Unable to cast object of type 'Microsoft.Maui.Controls.Handlers.ShellItemHandler' to type 'SimpleToolkit.SimpleShell.Handlers.SimpleShellItemHandler" HOT 1
- How to set or change active Tab UI HOT 3
- Multiple Navigation (page1=>page2=>page3) HOT 1
- Probably Behaviors not working in Simpleshell
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simpletoolkit.