fix session not being closed

master
Felix Pankratz 1 year ago
parent 0d61661e5d
commit bf575bf881

@ -95,7 +95,7 @@ class Client:
c = self.screen.getch() c = self.screen.getch()
story = self.loadedstories[self.topstories[self.story_pos + self.cursor_pos]] story = self.loadedstories[self.topstories[self.story_pos + self.cursor_pos]]
if c == ord('q'): # Quit if c == ord('q'): # Quit
self.exit() await self.exit()
elif c == curses.KEY_UP: elif c == curses.KEY_UP:
self.cursor_pos -= 1 self.cursor_pos -= 1
if self.cursor_pos < 0: if self.cursor_pos < 0:
@ -168,8 +168,8 @@ class Client:
self.draw() self.draw()
await self.handle_input() await self.handle_input()
def exit(self): async def exit(self):
self.session.close() await self.session.close()
curses.endwin() curses.endwin()
import sys import sys
sys.exit(0) sys.exit(0)

Loading…
Cancel
Save