mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fix login/logout buttons
This commit is contained in:
@ -15,6 +15,19 @@ public partial class SettingsView : ScreenBase<SettingsViewModel>
|
|||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.NexusLogout, view => view.NexusLogOut)
|
this.BindCommand(ViewModel, vm => vm.NexusLogout, view => view.NexusLogOut)
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
|
|
||||||
|
this.BindCommand(ViewModel, vm => vm.LoversLabLogin, view => view.LoversLabLogIn)
|
||||||
|
.DisposeWith(disposables);
|
||||||
|
this.BindCommand(ViewModel, vm => vm.LoversLabLogout, view => view.LoversLabLogOut)
|
||||||
|
.DisposeWith(disposables);
|
||||||
|
|
||||||
|
|
||||||
|
this.BindCommand(ViewModel, vm => vm.VectorPlexusLogin, view => view.VectorPlexusLogIn)
|
||||||
|
.DisposeWith(disposables);
|
||||||
|
this.BindCommand(ViewModel, vm => vm.VectorPlexusLogout, view => view.VectorPlexusLogOut)
|
||||||
|
.DisposeWith(disposables);
|
||||||
|
|
||||||
|
|
||||||
this.OneWayBind(ViewModel, vm => vm.Resources, view => view.ResourceList.Items)
|
this.OneWayBind(ViewModel, vm => vm.Resources, view => view.ResourceList.Items)
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
});
|
});
|
||||||
|
@ -24,7 +24,7 @@ public class SettingsViewModel : ViewModelBase
|
|||||||
public readonly IEnumerable<ResourceViewModel> Resources;
|
public readonly IEnumerable<ResourceViewModel> Resources;
|
||||||
|
|
||||||
public SettingsViewModel(ILogger<SettingsViewModel> logger, Configuration configuration,
|
public SettingsViewModel(ILogger<SettingsViewModel> logger, Configuration configuration,
|
||||||
NexusApiTokenProvider nexusProvider, IEnumerable<IResource> resources)
|
NexusApiTokenProvider nexusProvider, IEnumerable<IResource> resources, LoversLabTokenProvider llProvider, VectorPlexusTokenProvider vpProvider)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
Resources = resources.Select(r => new ResourceViewModel(r)).ToArray();
|
Resources = resources.Select(r => new ResourceViewModel(r)).ToArray();
|
||||||
@ -50,12 +50,37 @@ public class SettingsViewModel : ViewModelBase
|
|||||||
ReactiveCommand.Create(() => { MessageBus.Current.SendMessage(new NavigateTo(typeof(NexusLoginViewModel))); },
|
ReactiveCommand.Create(() => { MessageBus.Current.SendMessage(new NavigateTo(typeof(NexusLoginViewModel))); },
|
||||||
haveNexusToken.Select(x => !x));
|
haveNexusToken.Select(x => !x));
|
||||||
NexusLogout = ReactiveCommand.Create(nexusProvider.DeleteToken, haveNexusToken.Select(x => x));
|
NexusLogout = ReactiveCommand.Create(nexusProvider.DeleteToken, haveNexusToken.Select(x => x));
|
||||||
|
|
||||||
|
var haveLLToken = _fileSystemEvents
|
||||||
|
.StartWith(AbsolutePath.Empty)
|
||||||
|
.Select(_ => llProvider.HaveToken());
|
||||||
|
|
||||||
|
LoversLabLogin =
|
||||||
|
ReactiveCommand.Create(() => { MessageBus.Current.SendMessage(new NavigateTo(typeof(LoversLabOAuthLoginViewModel))); },
|
||||||
|
haveLLToken.Select(x => !x));
|
||||||
|
LoversLabLogout = ReactiveCommand.Create(llProvider.DeleteToken, haveLLToken.Select(x => x));
|
||||||
|
|
||||||
|
var haveVectorPlexusToken = _fileSystemEvents
|
||||||
|
.StartWith(AbsolutePath.Empty)
|
||||||
|
.Select(_ => vpProvider.HaveToken());
|
||||||
|
|
||||||
|
VectorPlexusLogin =
|
||||||
|
ReactiveCommand.Create(() => { MessageBus.Current.SendMessage(new NavigateTo(typeof(VectorPlexusOAuthLoginViewModel))); },
|
||||||
|
haveVectorPlexusToken.Select(x => !x));
|
||||||
|
VectorPlexusLogout = ReactiveCommand.Create(vpProvider.DeleteToken, haveVectorPlexusToken.Select(x => x));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> NexusLogin { get; set; }
|
public ReactiveCommand<Unit, Unit> NexusLogin { get; set; }
|
||||||
public ReactiveCommand<Unit, Unit> NexusLogout { get; set; }
|
public ReactiveCommand<Unit, Unit> NexusLogout { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public ReactiveCommand<Unit, Unit> LoversLabLogin { get; set; }
|
||||||
|
public ReactiveCommand<Unit, Unit> LoversLabLogout { get; set; }
|
||||||
|
|
||||||
|
public ReactiveCommand<Unit, Unit> VectorPlexusLogin { get; set; }
|
||||||
|
public ReactiveCommand<Unit, Unit> VectorPlexusLogout { get; set; }
|
||||||
|
|
||||||
public FileSystemWatcher Watcher { get; set; }
|
public FileSystemWatcher Watcher { get; set; }
|
||||||
|
|
||||||
private void Pulse(object sender, FileSystemEventArgs e)
|
private void Pulse(object sender, FileSystemEventArgs e)
|
||||||
|
Reference in New Issue
Block a user