tonickkozlov / vue-tweet-embed

Embed tweets in your vue.js app
111 stars 27 forks source link

How it handles tweet, if it has been deleted? #2

Closed DhruvAerosol closed 7 years ago

DhruvAerosol commented 7 years ago

As it can display loader, how to display any message or image if tweet is deleted or not available?

tonickkozlov commented 7 years ago

There's no such functionality in place yet since the library is just a wrapper over Twitter's API lib which does not support this. I'll take a look at this problem if I have a chance. If you have a solution in mind, please create a PR to this repo.

DhruvAerosol commented 7 years ago

I am not able to run the code. And i also want to create PR of my changes. but it shows "Permission to tonickkozlov/vue-tweet-embed.git denied to DhruvAerosol." what should i do now?.

tonickkozlov commented 7 years ago

You'd have to fork this repo, commit your changes and push them to your forked remote, and create a PR from there to this repo.

DhruvAerosol commented 7 years ago

Pull Request https://github.com/tonickkozlov/vue-tweet-embed/pull/5 Can we discuss this in this conversion? What should i add in tests? i have prepared tests same like given, just changed id '123' to '14' and DOM id 'foo1 => 'bar1'. i have run test and it shows: '9 tests passed'. so is it ok?' if it's not proper then can you add it i have mentioned in my forked code's ReadME file. Or guide me how can i add it.

append_tests.txt

tonickkozlov commented 7 years ago

Your PR has been merged, see v1.2.1

kumorig commented 6 years ago

I see this issue has been closed, I just thought that I'd add my use case, which is still not entirely resolved:

Say I always want to display 5 tweets:

  <Tweet v-for="(tweet,index) in tweets"
         v-if="index < 5"
         :key="tweet.id"
         :id="tweet.id"
         error-message="Missing or deleted tweet."
         error-message-class="tweet-error"></Tweet>

If there is a missing tweet I can easily hide it using CSS (Thanks!), but I'd also like to show the next tweet in my list.

I suggest that there should be an event emitted, something like this.$emit('tweet-error', tweet.id) whenever a tweet fails to load. That way we could do something about it without resorting to edit the component-files.

For example:

  <Tweet v-for="(tweet,index) in tweets"
         v-if="index < (5 + errorCount)"
         v-on:tweet-error="onTweetError"  // just some function that re-calculates errorCount
         :key="tweet.id"
         :id="tweet.id"
         error-message="Missing or deleted tweet."
         error-message-class="tweet-error"></Tweet>

@tonickkozlov Thanks for this neat little component! I've found it very useful.