mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
feat(mobile): ios oauth & magic-link login (#8581)
Co-authored-by: EYHN <cneyhn@gmail.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import type { Component } from './components/component';
|
||||
import type { Entity } from './components/entity';
|
||||
import type { Scope } from './components/scope';
|
||||
import type { Service } from './components/service';
|
||||
@@ -408,8 +407,6 @@ class FrameworkEditor {
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* override(OriginClass, NewClass, [dependencies, ...])
|
||||
* or
|
||||
* override(Identifier, Class, [dependencies, ...])
|
||||
* or
|
||||
* override(Identifier, Instance)
|
||||
@@ -418,10 +415,10 @@ class FrameworkEditor {
|
||||
* ```
|
||||
*/
|
||||
override = <
|
||||
Arg1 extends GeneralIdentifier<any>,
|
||||
Arg2 extends Type<Trait> | ComponentFactory<Trait> | Trait | null,
|
||||
Arg1 extends Identifier<any>,
|
||||
Arg2 extends Type<Trait> | ComponentFactory<Trait> | Trait,
|
||||
Arg3 extends Deps,
|
||||
Trait extends Component = IdentifierType<Arg1>,
|
||||
Trait = IdentifierType<Arg1>,
|
||||
Deps = Arg2 extends Type<Trait>
|
||||
? TypesToDeps<ConstructorParameters<Arg2>>
|
||||
: [],
|
||||
|
||||
@@ -55,7 +55,7 @@ export abstract class FrameworkProvider {
|
||||
getOptional = <T>(
|
||||
identifier: GeneralIdentifier<T>,
|
||||
options?: ResolveOptions
|
||||
): T | null => {
|
||||
): T | undefined => {
|
||||
return this.getRaw(parseIdentifier(identifier), {
|
||||
...options,
|
||||
optional: true,
|
||||
|
||||
@@ -23,7 +23,7 @@ export function useService<T extends Service>(
|
||||
): T {
|
||||
const stack = useContext(FrameworkStackContext);
|
||||
|
||||
let service: T | null = null;
|
||||
let service: T | undefined = undefined;
|
||||
|
||||
for (let i = stack.length - 1; i >= 0; i--) {
|
||||
service = stack[i].getOptional(identifier, {
|
||||
@@ -87,10 +87,10 @@ export function useServices<
|
||||
|
||||
export function useServiceOptional<T extends Service>(
|
||||
identifier: Type<T>
|
||||
): T | null {
|
||||
): T | undefined {
|
||||
const stack = useContext(FrameworkStackContext);
|
||||
|
||||
let service: T | null = null;
|
||||
let service: T | undefined = undefined;
|
||||
|
||||
for (let i = stack.length - 1; i >= 0; i--) {
|
||||
service = stack[i].getOptional(identifier, {
|
||||
|
||||
Reference in New Issue
Block a user