(pubsub) Refresh comments when a new one is added in wall posts and comments
This commit is contained in:
parent
33ba50a7b4
commit
ee6370bb0b
@ -58,7 +58,13 @@ class displayPostPresenter(base.basePresenter):
|
||||
self.worker = threading.Thread(target=self.load_all_components)
|
||||
self.worker.finished = threading.Event()
|
||||
self.worker.start()
|
||||
# connect here the pubsub event for successful posting of comments.
|
||||
pub.subscribe(self.posted, "posted")
|
||||
self.run()
|
||||
pub.unsubscribe(self.posted, "posted")
|
||||
|
||||
def posted(self, from_buffer=None):
|
||||
self.clear_comments_list()
|
||||
|
||||
def get_comments(self):
|
||||
""" Get comments and insert them in a list."""
|
||||
|
@ -40,7 +40,10 @@ class displayCommentPresenter(basePost.displayPostPresenter):
|
||||
# We'll put images here, so it will be easier to work with them.
|
||||
self.images = []
|
||||
self.imageIndex = 0
|
||||
# connect here the pubsub event for successful posting of comments.
|
||||
pub.subscribe(self.posted, "posted")
|
||||
self.run()
|
||||
pub.unsubscribe(self.posted, "posted")
|
||||
|
||||
def load_all_components(self):
|
||||
self.get_post_information()
|
||||
|
Loading…
Reference in New Issue
Block a user