Giter VIP home page Giter VIP logo

Comments (9)

KartikTalwar avatar KartikTalwar commented on May 18, 2024

@jamiebikies thanks for noticing this. So the first thing email_data() does is retrieves the email_id from the url. With the open_email observer, the data function is getting triggered the instant you click on an email from the inbox view where the url is still the inbox's. The quickest way to fix this is add a delay in the email_data function so a valid id is present. I'll try to fix it by tomorrow and see if this can be done without a delay

from gmail.js.

gilgen avatar gilgen commented on May 18, 2024

Hey @KartikTalwar, the delay is exactly what I've done for now. I'll take a look and submit a PR if you haven't got to it and I come up with a good way, like you said, to do it without a delay.

from gmail.js.

KartikTalwar avatar KartikTalwar commented on May 18, 2024

That PR for now would be great. From what I did to debug, L861 bloc always works (it knows that its inside the email) but api.get.email_id() in L862 still has the inbox view url.

from gmail.js.

KartikTalwar avatar KartikTalwar commented on May 18, 2024

@jamiebikies so the problem is that the observe callback gets executed right after its triggered. So when your callback requests the email_data, the data function runs between your click on the email and the email opening. If you add a 10 second delay to the email_data function, its going to wait 10s before opening the email. I just added a fix for this where the data function has been parameterized. This code will work

gmail.observe.on('open_email', function(id) {
  var data = gmail.get.email_data(id);
  console.log(data);
});

Feel free to reopen this issue if you find any inconsistencies

from gmail.js.

sweetaai avatar sweetaai commented on May 18, 2024

@KartikTalwar @jamiebikies i added above code in my script but still empty object got..but first time i got data but if i open email 2nd onwards then empty object got.Now i m using https://xmailchrome.appspot.com/gmail.js link gmail.js in my script. Can you tell me where i did wrong?

from gmail.js.

KartikTalwar avatar KartikTalwar commented on May 18, 2024

@sweetaai that js file is very outdated. It most likely does not have the fix from this issue. Please host gmail.js yourself so you can keep better track of code changes.

from gmail.js.

sweetaai avatar sweetaai commented on May 18, 2024

@KartikTalwar when i added below code in load.js then working fine.

var fb = document.createElement('script');
fb.src = "https://xmailchrome.appspot.com/gmail.js";
document.getElementsByTagName('body')[0].appendChild(fb);

but when added
var fb = document.createElement('script');
fb.src = "https://2.helloworld1test.appspot.com/js/gmail.js";
document.getElementsByTagName('body')[0].appendChild(fb);
then gmail is not defined exception got on console.There is no any difference. Only difference in gmail.js. So plz can you tell me where i did wrong?

from gmail.js.

KartikTalwar avatar KartikTalwar commented on May 18, 2024

@sweetaai the url is not a valid https url. I would recommend you host it on amazon s3

.

from gmail.js.

sweetaai avatar sweetaai commented on May 18, 2024

@KartikTalwar
Below is valid url
......................
but still not working.
I don't have amazon s3 space..If you have any updated gmail.js url can you send me?

from gmail.js.

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.