Git Product home page Git Product logo

Comments (13)

robmroi avatar robmroi commented on June 11, 2024

?

from kag-app.

robmroi avatar robmroi commented on June 11, 2024

I still dont understand what you mean here

from kag-app.

robmroi avatar robmroi commented on June 11, 2024

Unterstufen people are not permitted to see the RPlan.
-> Hide the RPlan or show a message

from kag-app.

robmroi avatar robmroi commented on June 11, 2024

Problem: It takes long to load that information. It would be better to cache the user group so that it does not download this information every time.
@strifel Please implement the caching mechanic sometime (before the release).

from kag-app.

robmroi avatar robmroi commented on June 11, 2024

Will close this issue.

from kag-app.

strifel avatar strifel commented on June 11, 2024

I think the Method isn't even async. Let me check

(EDIT:

List<dynamic> getGroups() {
< See this line. getGroups is sync. It only decodes the JWT so there should be no caching problem)

from kag-app.

robmroi avatar robmroi commented on June 11, 2024

But how can I access this without using an async function?
The only way I see is:
var groups = (await KAGApp.api.getAPIRequest(APIAction.GET_GROUPS)).getGroups();
I can't delete the await

from kag-app.

strifel avatar strifel commented on June 11, 2024

That's true but in this case it should take 0 seconds.
If this has to be used in a not async context, I have to fix this. Does it need to be?

from kag-app.

robmroi avatar robmroi commented on June 11, 2024

Yes, it needs to be synced. Right now it takes 1 second to complete and the build method gets called before initState() is completed. -> It shows an error while initState() isn't completed.

I will work on this issue when the method is sync.

from kag-app.

robmroi avatar robmroi commented on June 11, 2024

The method getAPIRequestSync does not work properly. It checks:

if (_isLogInNeeded(action) && action != APIAction.GET_USER_INFO && action != APIAction.GET_USERNAME)
So: For getGroups login is needed so the task can't be performed synchronously.

@strifel Please update the condition here. For now isLoginNeeded for getGroups is changed to false.

from kag-app.

strifel avatar strifel commented on June 11, 2024

The statement is completly fine.

from kag-app.

robmroi avatar robmroi commented on June 11, 2024

No. The reason requestSync was created was to be able to get the Groups synchronously. With your implementation/statement you can‘t access groups synchronously.

getGroups only works when the user is logged in -> either isLoginNeeded for getGroups needs to be false (which it doesn‘t) or the statement must be updated

from kag-app.

strifel avatar strifel commented on June 11, 2024

Oh. Maybe I had a little typo....

from kag-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.