mirror of
https://github.com/bitwarden/cli
synced 2025-12-19 17:53:14 +00:00
[refactor(Account Switching)] Implement StateService (#424)
This commit is contained in:
@@ -4,7 +4,7 @@ import * as path from "path";
|
||||
|
||||
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
||||
import { SendService } from "jslib-common/abstractions/send.service";
|
||||
import { UserService } from "jslib-common/abstractions/user.service";
|
||||
import { StateService } from "jslib-common/abstractions/state.service";
|
||||
|
||||
import { SendType } from "jslib-common/enums/sendType";
|
||||
|
||||
@@ -21,7 +21,7 @@ import { CliUtils } from "../../utils";
|
||||
export class SendCreateCommand {
|
||||
constructor(
|
||||
private sendService: SendService,
|
||||
private userService: UserService,
|
||||
private stateService: StateService,
|
||||
private environmentService: EnvironmentService
|
||||
) {}
|
||||
|
||||
@@ -73,7 +73,7 @@ export class SendCreateCommand {
|
||||
|
||||
switch (req.type) {
|
||||
case SendType.File:
|
||||
if (!(await this.userService.canAccessPremium())) {
|
||||
if (!(await this.stateService.getCanAccessPremium())) {
|
||||
return Response.error("Premium status is required to use this feature.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user