mirror of
				https://gitea.com/gitea/tea.git
				synced 2025-10-31 01:05:26 +01:00 
			
		
		
		
	Fix notification: --all dont relay on a repo (#159)
fix nil pointer exeption make notifications work outside a repo Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/159 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: mrsdizzie <info@mrsdizzie.com>
This commit is contained in:
		| @@ -46,9 +46,6 @@ var CmdNotifications = cli.Command{ | ||||
| } | ||||
|  | ||||
| func runNotifications(ctx *cli.Context) error { | ||||
| 	login, owner, repo := initCommand() | ||||
|  | ||||
| 	client := login.Client() | ||||
| 	var news []*gitea.NotificationThread | ||||
| 	var err error | ||||
|  | ||||
| @@ -58,11 +55,13 @@ func runNotifications(ctx *cli.Context) error { | ||||
| 	} | ||||
|  | ||||
| 	if ctx.Bool("all") { | ||||
| 		news, err = client.ListNotifications(gitea.ListNotificationOptions{ | ||||
| 		login := initCommandLoginOnly() | ||||
| 		news, err = login.Client().ListNotifications(gitea.ListNotificationOptions{ | ||||
| 			ListOptions: listOpts, | ||||
| 		}) | ||||
| 	} else { | ||||
| 		news, err = client.ListRepoNotifications(owner, repo, gitea.ListNotificationOptions{ | ||||
| 		login, owner, repo := initCommand() | ||||
| 		news, err = login.Client().ListRepoNotifications(owner, repo, gitea.ListNotificationOptions{ | ||||
| 			ListOptions: listOpts, | ||||
| 		}) | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 6543
					6543